Prevent scrolling of parent element with JavaScript

Dima Kuzmich
1 min readJul 16, 2013

--

In my current project I was asked to avoid scrolling of parent element, when reaching the end of the scroll of inner element.

It sounds like very simple task. Not when you want to implement it cross browser. So, I searched a little and found next example from the book: “JavaScript: The Definitive Guide”. By the way it’s very good book to start with when you want to learn JavaScript basics.

So, based on this example here is jsFiddle with my solution for a problem.

Enjoy

javascript-book

--

--