Home › Forums › CSS › Possible to toggle a div display based on what is currently viewable on screen? › Reply To: Possible to toggle a div display based on what is currently viewable on screen?
December 15, 2013 at 11:34 am
#158393
Participant
Probably the only way you can do it in CSS only: http://codepen.io/Merri/pen/pAmce
So you work with z-index to hide the fixed element behind scrolling elements.
If you want to get different behavior then JavaScript is the only way. CSS provides no mechanism to know scrolling position or if element is viewable on the screen/viewport.