[jQuery] Re: jQuery selector that matches dd's elements

2008-10-13 Thread Karl Swedberg
I doubt that will work, since all of the dd elements are siblings of the clicked dt. Mauricio, Take a look at the nextUntil plugin. That should do what you're looking for: http://docs.jquery.com/JQuery_1.2_Roadmap#.nextUntil.28.29_.2F_.prevUntil.28.29 After including the plugin, you can

[jQuery] Re: jQuery selector that matches dd's elements [SOLVED]

2008-10-13 Thread Mauricio (Maujor) Samy Silva
@Paperboy: Sorry, both solutions you pointed out selects ALL dd after the dt clicked. Tks! @Karl: The plugin you pointed out do the job. Tks! MaurĂ­cio

[jQuery] Re: jQuery selector that matches dd's elements [SOLVED]

2008-10-13 Thread ricardobeat
Already solved but I thought it would be fun to solve it by hand :D jQuery.fn.getDDs = function(){ var next = $(this[this.length-1]).next(); if(next.is('dd')){ return this.add(next).getDDs(); } else { return this.not('dt'); }; }; this is a bit faster: jQuery.fn.getDDs =

[jQuery] Re: jQuery selector that matches dd's elements

2008-10-12 Thread [EMAIL PROTECTED]
You could use something like this: $('dt:eq(0)').nextAll('dd').doSomething(); $('dt:eq(1)').nextAll('dd').doSomething(); $('dt:eq(2)').nextAll('dd').doSomething(); $('dt:eq(3)').nextAll('dd').doSomething(); $('dt:eq(4)').nextAll('dd').doSomething(); // and so on...

[jQuery] Re: jQuery selector that matches dd's elements

2008-10-10 Thread [EMAIL PROTECTED]
This should work for you: $('dt').click(function() { $(this).nextAll('dd').doSomething() });