Window starts with scrolled to the bottom Wordpress detailed page
I have an issue where a specific page is starting with scrolled down at the detailed page of Wordpress.
Is there a way to overcome this issue?
What could be the cause?开发者_StackOverflow中文版
I've tried:
$(document).live('ready',function(){
$('html, body').animate({scrollTop:0}, 'slow');
});
But it doesn't seem to work...
If you have a hash in url that leads to the page like #more-1128 in your example, then most browsers will automatically scroll the page to make element with id matching hash visible.
To get rid of this behavior, either remove/change id of element that has id="more-1128", or remove the hash in the url/links that lead to your page.
BTW, don't use $(document).live('ready')
it doesn't really make sense since ready
event is fired only once when the page is loaded. $(document).ready(...)
will be totally fine here.
精彩评论