2

This is a variation of the question of sticking a div to the top of the page. Instead I need a div to stick to the top of its parent div, which has been set to overflow: auto.

http://jsfiddle.net/7F22m/ (Code cobbled from here.)

#sticky should stick to the top of #wrapper once it reaches the top of #wrapper.

Community
  • 1
  • 1
asymptote
  • 325
  • 1
  • 4
  • 13
  • http://stackoverflow.com/questions/5191156/jquery-how-to-make-a-fixed-div-scroll-horizontally-after-scrolling-vertically – Dhiraj Jun 07 '12 at 14:06

1 Answers1

0

They're multiple ways of making this work… A bit of guidance: http://jsfiddle.net/WykZ5/3/

The code above isn't perfect but should be a start. The reason it wasn't working is that the code didn't get launched.

Do you use console.log() to debug? If not Google it. It will help a lot.

Also check out: http://twitter.github.com/bootstrap/javascript.html#scrollspy

I used mostly used this code as reference: https://github.com/twitter/bootstrap/blob/master/docs/assets/js/application.js#L61

iDev247
  • 1,761
  • 3
  • 16
  • 36