I'd like to trigger scrolling of a div with overflowing content by scrolling anywhere on the page, not just by moving the mouse and clicking within the div. Also, i'd like to hide the div's scrollbar such that only the page's scrollbar is visible.
Preferably the solution would be CSS-based but a JS solution would work too.
here's my jsfiddle that demonstrates the problem: http://jsfiddle.net/trpeters1/RMZsX/8/
I'd copy the code here but there I put a bunch of filler text to trigger the scrollbars.
For you reference though, the name of the internal div I'd like to scroll on scrolling the page has an id="scrollMeToo"
.
you can set overflow:hidden for div .and set css to deselection div content.
This should do what you need, if you don't want the document to scroll, just change the
return true;
toreturn false;
.Non-jQuery method:
In order to change the scrolling speed, simply modify this block to suit your needs:
Just change the
10
values to whatever you need.Update:
This modification should suit your needs, according to what you've described. I've also altered the function slightly for some general fixes.
The content will appear just before the bottom of the div is reached, and will only appear once.