The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How do I add this feature?

View previous topic View next topic Go down

How do I add this feature?

Post by Cool-Guy on February 9th 2012, 1:09 pm

http://www.footstepsofghosts.com/

At the right of this site, there is a symbol saying "top" if hovering it. If you click it, it takes you to the top of the forum.

How do I add this feature, and is it possible to choose exact location?

Thanks. I love you

Cool-Guy
Forumember

Posts : 295
Reputation : 0
Language : English

Back to top Go down

Re: How do I add this feature?

Post by ReDMizT on February 9th 2012, 2:02 pm

@Cool-Guy wrote:http://www.footstepsofghosts.com/

At the right of this site, there is a symbol saying "top" if hovering it. If you click it, it takes you to the top of the forum.

How do I add this feature, and is it possible to choose exact location?

Thanks. I love you

put this in your overall_footer_end

Code:
 <script type="text/javascript">
  jQuery(document).ready(function(){
      jQuery('body').prepend('<span id="bm-top" />');
      jQuery('body').append('<a href="#bm-top" id="bm-arrow-top">Back To Top</a>');
      jQuery('#bm-arrow-top').bm_topLink({
        min: 200,
        fadeSpeed: 500
      });
      jQuery('#bm-arrow-top').click(function(e) {
        e.preventDefault();
      });     
      jQuery('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
       
            var $target = jQuery(this.hash);
            $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
           
            if ($target.length) {
              var targetOffset = $target.offset().top;
              jQuery('html,body').animate({scrollTop: targetOffset}, 1000);
              return false;
            }
        }
      });     
  });
  jQuery.fn.bm_topLink = function(settings) {
      settings = jQuery.extend({
        min: 1,
        fadeSpeed: 200
      }, settings);
      return this.each(function() {
        var el = jQuery(this);
        el.hide();
        jQuery(window).scroll(function() {
            if (jQuery(window).scrollTop() >= settings.min) {
              el.fadeIn(settings.fadeSpeed);
            } else {
              el.fadeOut(settings.fadeSpeed);
            }
        });
      });
  };
</script>
<style type="text/css"> 
a#bm-arrow-top {position:fixed;  bottom:30px;right:30px;  display:block;background:#fff; width:24px;height:24px; overflow:hidden; background:url(http://www.net-kit.com/wp-content/plugins/back2top/backtotop.png) top left no-repeat; text-indent:-99999em; text-decoration:none; outline:none;  border:none;}
a:hover#bm-arrow-top {background-position:bottom left;}
</style>

ReDMizT
Forumember

Male Posts : 178
Reputation : 4
Language :
Location :

Back to top Go down

Re: How do I add this feature?

Post by Cool-Guy on February 9th 2012, 2:19 pm

And that is?

Cool-Guy
Forumember

Posts : 295
Reputation : 0
Language : English

Back to top Go down

Re: How do I add this feature?

Post by ReDMizT on February 9th 2012, 2:48 pm

you said that you want the "back to top" and that is the code...

ReDMizT
Forumember

Male Posts : 178
Reputation : 4
Language :
Location :

Back to top Go down

Re: How do I add this feature?

Post by Cool-Guy on February 9th 2012, 4:06 pm

Obviously I was referring to what you actually said, which would mean that I am asking what the "overall_footer_end" is...

Cool-Guy
Forumember

Posts : 295
Reputation : 0
Language : English

Back to top Go down

Re: How do I add this feature?

Post by ReDMizT on February 9th 2012, 4:21 pm

@Cool-Guy wrote:Obviously I was referring to what you actually said, which would mean that I am asking what the "overall_footer_end" is...

oops sorry you can find the overall_footer_end in admin panel => display => templates => general and look for overall_footer_end

ReDMizT
Forumember

Male Posts : 178
Reputation : 4
Language :
Location :

Back to top Go down

Re: How do I add this feature?

Post by Cool-Guy on February 9th 2012, 4:37 pm

No problem, except that if you take a look at my profile, you will see that I am on phpBB 3, which means I can't edit anything from that place.

Cool-Guy
Forumember

Posts : 295
Reputation : 0
Language : English

Back to top Go down

Re: How do I add this feature?

Post by LGforum on February 9th 2012, 11:37 pm

You can use a simple back to the top link like so:

Code:

<a href="#">Back To the Top</a>

Fancy back to the top animations are horrible and hard on the system.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum