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?
Asked
Active
Viewed 134 times
0
-
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 Answers
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.

Charles-Édouard Coste
- 1,604
- 12
- 24
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