Home › Forums › JavaScript › Make element sticky on touch screens only happens after scroll is finished › Reply To: Make element sticky on touch screens only happens after scroll is finished
I think it’s a commonly accepted way to give an element it’s own stacking context…
Although I cannot explain why it makes the element respond to the scroll event sooner. I was convinced that it wouldn’t fire at all until the panning is released.
Edit :
Before iOS 8, Appleās mobile browser did not continuously fire scroll events
So I would imagine it only works for those later versions. It also seems they were late to the party (and I to get informed) with that:
It’s not just the mobile iOS browser that acts odd with nested fixed elements by the way. I just rewrote an old page where several fixed elements would disappear on Chrome and Opera desktop when scrolling. Fixed that by making them direct children of body
.