I'm having that annoying .scrollTop()
not working problem. I'm trying to get the page to start at the top every time you hit the refresh button. To do this I added the $('html,body').scrollTop(0)
to the $(document).ready
. Works fine in Firefox but not in Chrome nor Safari. The scrollTop
function works fine throughout the page (i.e. smooth scroll links), just not when you hit refresh on the page.
I am at a loss; tried different combos: $('html')
, $('body')
, $('html,body')
, $(document)
,$(window)
...
$(document).ready(function() {
$('html,body').scrollTop(0);
});