Streaming live at 10am (PST)

How to make a sticky element


#1

Thanks @vincent that is great. It's not great on mobile though, but nice for web.

Thanks for your fast response.

I am now looking into persistant headers https://css-tricks.com/persistent-headers/

Is this the same as putting an element on fixed with a high z-index or something different.


How to "Autofocus"
#2

What you're reffering to are sticky elements. Your example is a bit more complex because the sticky elements vanishes when its context (the table) goes out of screen. Usually you'll find this behavior for navigation bars.

It's more complex.

Even if there's a way with only CSS it requires a "sticky" property of webkit that is too new to be supported by all browsers.

So it requires Javascript, here is a simple approach:

http://www.hongkiat.com/blog/css-sticky-position/


#3