[jQuery] Re: The simplest of questions I'm sure...

2008-05-16 Thread Karl Swedberg
Ugh! That's what I get for not testing. Your code had an error: $("dd:visible)") should be ... $("dd:visible") So the whole thing... $(document).ready(function(){ $("dd:not(:first)").hide(); $("dt a").click(function(){ var $next = $(this).parent().next(

[jQuery] Re: The simplest of questions I'm sure...

2008-05-16 Thread Karl Swedberg
Oops. I didn't close the if condition's parentheses. Sorry about that. This line ... if ($next.is(':visible') { should be ... if ($next.is(':visible')) { --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 16, 2008, at 2:25 PM, Karl Swedberg wrot

[jQuery] Re: The simplest of questions I'm sure...

2008-05-16 Thread Karl Swedberg
HI Robin, You can check for the visibility of the dd and then only show it if it isn't visible to begin with. Untested and unindented: $(document).ready(function(){ $("dd:not(:first)").hide(); $("dt a").click(function(){ var $next = $(this).parent().next();