In El Capitan, how can I prevent the Mac bluetooth mouse from from 'carrying' its scroll between different elements on a single page? Let's say there's a web page that can be scrolled through and within that page there's also a box that can be scrolled through. Currently, if I do one scroll on the mouse while the cursor is in the main page and then move the cursor into the smaller scrollable part of the page while the larger part is scrolling, the large part will stop scrolling and the smaller part will start scrolling.

Or if I just start scrolling in the main part of the page, move the cursor to, say, the desktop, and then quickly cursor back to it, the scroll will start, stop when I leave, and then scroll a little more when I get back.

How can I stop this behavior? I'd like all scrolling to end as soon as I leave the element in which I started scrolling. It's annoying for work because I'll scroll, get to where I want, then move to another element, and then that element scrolls using the scroll I started elsewhere. This seems like a design flaw to me.
Actually, this is not a thing you can fix on the operating system as technically you still are using the same window/part of a window which is a web view (in whatever browser you are using).

This can only be really fixed by the webpage itself by not making some elements scrollable. For example it's possible to deactivate scroll-zoom in some map providers widgets.

I'm sorry to say that you may not be able to switch this off on an OS Level. Depending on the web browser you are using, there might be an extension that forces to turn scrolling off for some elements but that would most likely lead to partly unusable web pages if you ever need to scroll some of these elements.