javascript - Scrolling child div scrolls the page only in IE8 -
i have div in page has scroll bar, when div scroll ends page scrolling starts. default behavior of browser, still want stop scrolling page once div scroll ends. have fix here sample have created in fiddle.
but above solution works chrome, firefox, ie9. not working in ie8.
please let me know if find solution this.
thanks, gopi
as andrew stated above, have tried demo @amustill (prevent scrolling of parent element?)?
demo:
js:
$(function() { var toolbox = $('#toolbox'), height = toolbox.height(), scrollheight = toolbox.get(0).scrollheight; toolbox.bind('mousewheel', function(e, d) { if((this.scrolltop === (scrollheight - height) && d < 0) || (this.scrolltop === 0 && d > 0)) { e.preventdefault(); } }); }); html:
<div id="toolbox"> text scrolls... </div> this requires jquery , jquery mousewheel plugin.
Comments
Post a Comment