How can I bind the page's scroll bar to a particular div instead of the entire page. See Google Plus for an example of this functionality.! https://i.stack.imgur.com/Ab82L.png
Asked
Active
Viewed 866 times
-2
-
Go to Google Plus and Scroll down the page... You will see that div is scrolling... not a page – EarthUser Nov 14 '12 at 18:23
-
Try this answer maybe? http://stackoverflow.com/questions/1193414/scrolling-a-div-with-jquery – Lukas1 Nov 14 '12 at 18:30
2 Answers
2
You can use position fixed panels down the left and across the top. The body will still scroll as normal, but the panels on the sides will make it look like only part of the page is scrolling.

Douglas
- 36,802
- 9
- 76
- 89
-
I alredy do that... but i have overlap another div, when i stretch my page lower than min-width – EarthUser Nov 14 '12 at 18:44
0
If you don't want to mess with the browser's native scrollbar, you could always
- Create a container
- Set the height and width of the container to 100%
- Set overflow to scroll (or auto)
That way you created your own viewport and have more control.

Joseph Spens
- 668
- 7
- 12
-
i have header div in a body and scroll bar not fully visible in container :( – EarthUser Nov 14 '12 at 18:27