Reputation: 12378
I have two divs in this sample code. If you scroll down and past the end of the blue div, the overall body/div also scrolls down. Is there a way to prevent the other scrolling effect even if I'm past a scroll boundary on the blue div?
i.e. when the blue div scrolls and reaches a boundary, nothing else should scroll.
sample: http://jsfiddle.net/nXN9H/
css solution prefered, but a simple js/jquery solution would be suffice.
Upvotes: 2
Views: 96
Reputation: 40970
I think you want something like this
body
{
overflow:hidden;
}
You can also try this
<div onmouseover="document.body.style.overflow='hidden';" onmouseout="document.body.style.overflow='auto';" >
Upvotes: 2