/ Published in: jQuery
This is a simple way to scroll to the top of the page, when an anchor tag has been clicked. Note that we must "return false," in order to disable the default browser action.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('#someAnchor').click(function() { $('html, body').animate({ scrollTop:0 }, 'fast'); return false; });