I have used a scrollTop
function in jQuery for navigating to top, but strangely \'the smooth animated scroll\' stopped working in Safari and Chrome (scrolling w
I have used this with success in Chrome, Firefox, and Safari. Haven't been able to test it in IE yet.
if($(document).scrollTop() !=0){
$('html, body').animate({ scrollTop: 0 }, 'fast');
}
The reason for the "if" statement is to check if the user is all ready at the top of the site. If so, don't do the animation. That way we don't have to worry so much about screen resolution.
The reason I use $(document).scrollTop
instead of ie. $('html,body')
is cause Chrome always return 0 for some reason.