Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

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

#250082
Shikkediel
Participant

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:

scroll-event-change-ios-8

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.