0

I need my sidebar to be scrollable along with the rest of the page until it reaches the end of the content in the sidebar, then it needs to be fixed. A good example of this is Facebooks right sidebar.

Is the only way to use javascript or can it be done without?

If javascript is the only out, can someone explain this relatively simple or refer to a tutorial? I'm not that strong in js.

Thanks for your time!

Giveny
  • 69
  • 10
  • Please do provide a jsFiddle in the future it's free and it helps other users –  Oct 30 '13 at 20:42
  • 1
    I think this does roughly what you're asking but may need slight tweaking: http://stackoverflow.com/a/5903087/717383 – James Montagne Oct 30 '13 at 20:45

1 Answers1

1

I just positioned the <div id="box"></div> fixed positioning to the body which has a position of relative applied. Here is the jsFiddle http://jsfiddle.net/2qwEs/