W3C home > Mailing lists > Public > www-style@w3.org > December 2014

[selectors] Proposal :enter and :leave

From: John Fischer <jfroffice@gmail.com>
Date: Thu, 18 Dec 2014 20:09:33 +0100
Message-Id: <687028F7-49F6-44AA-AB28-9D5CF977584E@gmail.com>
To: www-style@w3.org
:enter would be an pseudo class to detect when an DOM element will enter 
in the viewport of the browser.

This could happend, when page is loaded, scrolled or resized.

:leave would be the opposite meaning that it will occur when an DOM element will leave the viewport of the browser.

You can find a sample of this behavior by looking at the below library which reproduces this behavior by adding dynamically "enter" and "leave" class on some specific DOM elements.

http://jfroffice.github.io/x-enterleave.js/

That would be handsome and quite useful to design "enter / leave" animation.

This purpose might also be extend to bind the same kind of event according the parent DOM element.
But it will cost maybe more in implementation. (even if overflow css properties look more less like an already implemented algorithm in the browser).

I hope my proposal is quite understandable.

Do not hesitate, for some feedback.

Maybe I missed something and this problematic has been already debated.


- John
Received on Friday, 19 December 2014 13:52:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:49 UTC