The Arcive of vBulletin Modifications Site. |
|
Create "Back to top" button using jQuery in one step. Details »»
|
|||||||||||||||||||||||||||
|
Create "Back to top" button using jQuery in one step.
Developer Last Online: Dec 2013
Demo: http://noct-test.blogspot.com/2011/01/ai-duong.html
Instruction: Find template footer. Insert at the end. Code:
<style type='text/css'>
#bttop{border:1px solid #4adcff;background:#24bde2;text-align:center;padding:5px;position:fixed;bottom:35px;right:10px;cursor:pointer;display:none;color:#fff;font-size:11px;font-weight:900;}
#bttop:hover{border:1px solid #ffa789;background:#ff6734;}
</style>
<div id='bttop'>BACK TO TOP</div>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript'>$(function(){$(window).scroll(function(){if($(this).scrollTop()!=0){$('#bttop').fadeIn();}else{$('#bttop').fadeOut();}});$('#bttop').click(function(){$('body,html').animate({scrollTop:0},800);});});</script>
Hope you like it ! ![]() Show Your Support
|
|||||||||||||||||||||||||||
| 7 благодарности(ей) от: | ||
| davut_c20, dorans, elsa23, fxdigi-cash, Judith2, rodriiverduguez, seventhaxis | ||
| Comments |
|
#2
|
|||
|
|||
|
Great. Thank You
|
|
#3
|
|||
|
|||
|
nice one. If I may add
Code:
{vb:rawphrase top}
Code:
<div id='bttop'>BACK TO TOP</div> |
|
#4
|
||||
|
||||
|
Quote:
|
|
#5
|
|||
|
|||
|
I though so
so here is what I have done ![]() in headiclude before that < script yahoo blah-blah-blah > a add this as i'm using it for something else as well Code:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> Code:
#bttop{
padding:5px;
position:fixed;
bottom:55px;
right:10px;
cursor:pointer;
}
in the footer on the very end as you said Code:
<vb:if condition="$show['member']">
<div id='bttop'><img src="./images/misc/gotop.png" alt="{vb:rawphrase top}" height="72" width="72"/> </div>
<script type='text/javascript'>$(function(){$(window).scroll(function(){if($(this).scrollTop()!=0){$('#bttop').fadeIn();}else{$('#bttop').fadeOut();}});$('#bttop').click(function(){$('body,html').animate({scrollTop:0},900);});});</script>
</vb:if>
P.S.> sure I got an opensourse icon from opensoure-icon-web-site and up it into images/misc folder Thanks again Kinda lost the concept of one step but I like the things in own place it helps avoiding duplicate redundancies |
|
#6
|
|||
|
|||
|
Thanks a nice idea
Code works fine with VB4 But does not work with VB3 Please tell me how to make it work with VB3 with my best regards |
|
#7
|
|||
|
|||
|
Awesome mod we love it.
Just one problem with VB CMS on our home page its interfering with our slider vFCoders - Featured Content Slider Widget (was not able to change images/articles. Is there an easy way to exclude/disable it from a page or url? |
|
#8
|
|||
|
|||
|
Same problem here ..
|
|
#9
|
|||
|
|||
|
Quote:
Thanks. |
|
#10
|
||||
|
||||
|
Great, works fine
G! |
![]() |
|
|