DEV Community

Dima Kuzmich
Dima Kuzmich

Posted on • Originally published at Medium on

Prevent scrolling of parent element with JavaScript

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

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

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

Enjoy

javascript-book


Top comments (0)