-2

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

EarthUser
  • 23
  • 7

2 Answers2

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
0

If you don't want to mess with the browser's native scrollbar, you could always

  1. Create a container
  2. Set the height and width of the container to 100%
  3. Set overflow to scroll (or auto)

That way you created your own viewport and have more control.

Joseph Spens
  • 668
  • 7
  • 12