[jQuery] Next Div
This is probably simple, but I keep messing it up. I have a list of anchor links with hidden divs between them. I want to put a toggle on all of the A links to open up the div which is right next to it. This is the code snippet: $(a.questionLink).toggle(function(){ $(div.NEXTDIV).slideDown(slow); },function(){ $(div. NEXTDIV).slideUp(slow); }); I am not sure if I should use E:first-of-type or next(). Thank you for the help! Glen ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Next Div
This ought to work: $(a.questionLink).toggle(function(){ $(this).next().slideDown(slow); },function(){ $(this).next().slideUp(slow); }); m. On Wed, 2006-09-06 at 13:30 -0700, Lipka, Glen wrote: This is probably simple, but I keep messing it up. I have a list of anchor links with hidden divs between them. I want to put a toggle on all of the A links to open up the div which is right next to it. This is the code snippet: $(a.questionLink).toggle(function(){ $(div.NEXTDIV).slideDown(slow); },function(){ $(div. NEXTDIV).slideUp(slow); }); I am not sure if I should use E:first-of-type or next(). Thank you for the help! Glen ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Next Div
On Sep 6, 2006, at 4:30 PM, Lipka, Glen wrote:I have a list of anchor links with hidden divs between them.I want to put a toggle on all of the A links to open up the div which is right next to it. Try this: $("a.questionLink").toggle(function(){ $(this).next('div').slideDown("slow"); },function(){ $(this).next('div').slideUp("slow"); }); return false; }); Cheers,Karl___Karl Swedbergwww.englishrules.comwww.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Next Div
On Sep 6, 2006, at 4:44 PM, Karl Swedberg wrote:Try this: $("a.questionLink").toggle(function(){ $(this).next('div').slideDown("slow"); },function(){ $(this).next('div').slideUp("slow"); }); return false; }); Oops! It looks like I accidentally pasted an extra line at the end there -- });But you already figured it out anyway. ;-)___Karl Swedbergwww.englishrules.comwww.learningjquery.com___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/