3 ms·
I've seen this kind of behaviour on a few sites. I thought it was achieved by having the position fixed on the element, as soon as JS detected that the elemen
by inthewind 13y ago
I've seen this kind of behaviour on a few sites. I thought it was achieved by having the position fixed on the element, as soon as JS detected that the element was moving out of the document window.
There's a time and a place for this sort of thing. I personally get a little annoyed with fixed headers as it can break text paging. Text gets hidden under the header. When you hit page-down you get another page worth of text but the fixed element obscures the text.
Can position: sticky help with something like that?
- etherealG 13y agoi think the correct fix for this is for the browser to realise that some of the height is obscured by position:fixed elements, and only scroll the rest of the height on a page-down keypress. a javascript version of the same wouldn't be possible, so yes, this can help. whether it's implemented like that yet i'm not sure, perhaps open a bug with webkit / gecko if not.
- asadotzler 13y agoFirefox already does this and has for some time.
- inthewind 13y agoReally? Not for me, and I' m on Nightly. Perhaps we are talking about different things. http://pastebin.com/5eDi9WDW http://pastebin.com/5eDi9WDW