I've noticed that if trying to hide the scroll bar using overflow:hidden
scrolls the site to the top if this CSS style is used for html
and body
elements:
html,body {
height: 100%;
}
This is the jQuery code used:
$('#end').click(function(){
$("html, body").css("overflow", "hidden");
});
Living demo: http://jsfiddle.net/hYNGn/
This happens in all major browsers: Chrome, Firefox, IE9, Opera...
How can avoid this behavior?
Thanks.