0

Is there a way to fix a div using position:fixed in only top to bottom direction; i.e when I scroll from left to right the div should not be fixed. It should behave as a absolute positioned element. It should be fixed only when I scroll from top to bottom. Is it possible?

JSW189
  • 6,267
  • 11
  • 44
  • 72
Kowshik
  • 73
  • 1
  • 2
  • 9
  • Don't think it's possible with purely CSS, but check [this jQuery solution](http://stackoverflow.com/questions/6067603/fixed-position-div-vertical-only) – George Dec 17 '12 at 12:00

2 Answers2

1

It's not possible, because it's not supposed to be.

The action of "scrolling" may be very different from a browser to an other... from a device to an other... So it's not predictable.

0

If you want pure good solution then, I would recommend you use jQuery. If you will implement it using CSS then it may not be smooth.

Surinder ツ
  • 1,778
  • 3
  • 16
  • 27