Re: CSS pseudo-selector :closest and :further

It'll allow you match the *closest* element from *base selector*.

A live example (not that I "hacked" it because it not is supported
currently):
http://jsfiddle.net/de1j1su5/

*Possible signatures:*

body:closest(.text)

body .text:closest()

body :closest(.text)



2015-03-18 14:36 GMT-03:00 Brian Kardell <bkardell@gmail.com>:

> On Tue, Mar 17, 2015 at 12:08 PM, David Rodrigues
> <david.proweb@gmail.com> wrote:
> > I don't know if here is the right place, but will be great if create a
> new
> > pseudo-selector definition that allow select closest or further element
> from
> > a base element. For instance:
> >
> I'm pretty sure I don't understand the proposal, but :closest as
> pioneered by jQuery a proposal is already a thing in the complete
> profile https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
> (at least in whatwg and it has implementations and polyfills), you
> might want to look at that and avoid overloading the meaning.
>
>
>
>
>
> --
> Brian Kardell :: @briankardell :: hitchjs.com
>



-- 
David S. Rodrigues

Received on Thursday, 19 March 2015 17:55:49 UTC