1

I'm not even sure I'm describing this properly, but basically I want to display a leaderboard ad the way www.okcupid.com has setup.

I found this question helpful (http://stackoverflow.com/questions/3303173/position-element-fixed-vertically-absolute-horizontally) but it stays fixed. I would prefer it to scroll with the page until it reaches the top and then be fixed. Any ideas?

Ryan Grush
  • 2,076
  • 3
  • 37
  • 64

1 Answers1

1

You would use JavaScript.

The element will have normal flow on your page, and when the document.body.scrollTop is larger than the element's y position, give it position: fixed.

alex
  • 479,566
  • 201
  • 878
  • 984