I need a "back to top"button script that follows me on the website.
Author: Jorge L.
Visited 3069,
Followers 1,
Shared 0
I need a "back to top"button script that follows me on the website. Could please someone be so kind to help me with this . I am making a very large website and I would need this feature, I dont see any options on website x5 10 so I came here to ask for help. THANK YOU.
Posted on the
HTML
place this inside the body of your web page. before the < /body > tag.
view sourceprint?1<divid="backtotop">2 <ahref="#">3 <imgsrc="your-image-folder/back_to_top_btn.jpg"border="0"alt="Back to TOP"/>4 </a>5</div>
CSS
place this inside the head of your web page. before the < /head > tag.
view sourceprint?01<styletype="text/css">02#backtotop{03 position: fixed;04 right:0px;05 bottom:15px06}07#backtotop a{08 text-decoration:none;09 border:0 none;10 display:block;11 width:26px;12 height:150px;13}14#backtotop a:hover{15 opacity:.8; /*mouse over fade effect*/16}17 18</style>
JS
place this inside the head of your web page. before the < /head > tag.
view sourceprint?01<!-- include latest jQuery Library -->02<scripttype="text/javascript"src="your-js-folder/jquery.js"></script>03 04 05<!-- effortless script below -->06<scripttype="text/javascript">07 jQuery(document).ready(function(){08j Query('#backtotop a').click(function(){09 jQuery('html, body').animate({scrollTop:0}, 'slow');10 return false;11 });12 });13</script>
Author
^^ That didnt work...
just use "#" like a url :)
Author
Could you explain what do you mean by "use # like a url"? Sorry I am new to this....
for ex. add some text on your website bottom and link it with "#" when somebody will click that text if you page url is example.com they will be linked on example.com/# which will bring the to the top.
Hope this help