/ Published in: jQuery

Easy "back to top" scroll link
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
HTML: <a href="#" class="backToTop">Back to top</a> jQuery: $(document).ready(function(){ $('a.backToTop').click(function(){ $('html, body').animate({scrollTop: '0px'}, 300); event.preventDefault(); }); });
Comments
