Reputation: 20444
Is it possible to disable the ability for the mouse wheel to scroll the page whilst it is inside a certain DIV. That way it can only scroll the div and not the page. JQuery libraries are installed so I imagine it would be something along the lines of .scroll() and stop.pagination but I do not know enough about how to do this.
Any ideas?
Marvellous
Upvotes: 3
Views: 5166
Reputation: 20444
Fixed it.
$('.scrollable').mouseenter(function(){
$('body').css('overflow', 'hidden');
});
$('.scrollable').mouseleave(function(){
$('body').css('overflow', 'auto');
});
Upvotes: 3
Reputation: 146310
Pure css.
For the div you want to scroll:
#divId {
overflow: scroll;
height: someHeight;
}
Upvotes: 0