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:

http://jsbin.com/ixura3/3/

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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -