Re: [css-position] events for position sticky

On Fri, Mar 11, 2016 at 3:47 PM, Aurelio De Rosa <> wrote:

> Hi everyone.
> The specifications of position: sticky don't mention any event fired when
> an element is stuck and when it returns to its original position, for
> example something like stickystart and stickyend. I think this could be
> very useful and it has different use cases.
> The first use case is a website that needs to decrease the margin of a
> navigation bar when it starts sticking. Another use case might be to have
> an element that takes the full width of the page when it's sticking but a
> different width when it's in its original position.
> Has anyone thought about this possibility? Has this topic been discussed
> before?

You should just do all of these in CSS. It doesn't seem to me any of you
requirements is undoable in CSS. Probably you need more concrete example.

In addition, what sticky wants to do is to make this effect
JavaScript-free, so that it could be smoothly rendered. If you want to use
JavaScript, you can just go back and listen on scroll event and do
everything you like there. Using sticky with those two events wouldn't make
anything better than just using scroll event, I suppose.

- Xidorn

Received on Tuesday, 15 March 2016 14:52:13 UTC