Very nice, thanks!
For some reason I assumed that next() would return the next element that
matches the selector, not just the next element *if* it matches the
selector.
I like your implementation of nextOf. It seems like it would be faster than
my nextAll alternative.
-Hector
On Tue, Nov 18, 2
Here's a quick function that walks forward one element at a time until
one matches the selector:
$.fn.nextOf = function(sel){
var next = this,n;
do {
next = next.next();
n = next.filter(sel);
if (n.length) return n;
} while(next.length);
return this.filter(
On Tue, Nov 18, 2008 at 7:57 PM, Hector Virgen <[EMAIL PROTECTED]> wrote:
>
> It seems to me that $#next() gets the very next element, then tries to
> match it to the selector. Is this the intended behavior?
>
Yes, it gets the very next element and then applies the selector as a
filter. For the o
On Tue, Nov 18, 2008 at 7:57 PM, Hector Virgen <[EMAIL PROTECTED]> wrote:
>
> It seems to me that $#next() gets the very next element, then tries to
> match it to the selector. Is this the intended behavior?
>
Yes, it gets the very next element and then applies the selector as a
filter. For the o
Correction: that last console.log does report "Third" as expected.
-Hector
On Tue, Nov 18, 2008 at 4:57 PM, Hector Virgen <[EMAIL PROTECTED]> wrote:
> I have a simple list of items, and I am dynamically disabling them by
> adding a class name of "disabled" to the . When I try to select the next
5 matches
Mail list logo