Just a quick note about it:

It is designed to be as specific as possible and works with sibling
elements. I just looked at the code and found a couple of unused
variables and some parts that could be optimized a bit, but overall,
it's pretty fast. I uploaded it on Friday in a bit of a hurry (I was
leaving work). In the while loop, I use jQuery.fn.parent() instead of
el.parentNode because if the element hasn't been added to the DOM
yet, .parentNode won't work, but .parent() will. Some detection of
whether the element is in the DOM yet had to be done too because
jQuery will add an extra parent div to anything html/elements that is
passed through the jQuery() function.

I've also written a bunch of unit tests for it and so far so good.
Lemme know if you guys find it useful.

--
T


On Aug 2, 10:18 pm, tres <treshug...@gmail.com> wrote:
> Wrote a plugin for it.
>
> http://code.google.com/p/jquery-plugin-dev/source/browse/trunk/jquery...
>
> On Aug 2, 6:44 am, George <george.jqu...@softwareunity.com> wrote:
>
>
>
> > Yep, that first solution works well. I've used something similar on a
> > recent project.
> > (If performance is critical then as well as tweaking the while loop
> > I'd be inclined to use .length instead of .size() and to ditch
> > the .toLowerCase() method.)
>
> > George
>
> > On Jul 31, 2:34 pm, Julian Aubourg <aubourg.jul...@gmail.com> wrote:
>
> > > The issue with simple code like this are siblings.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to