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(
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
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();
3 matches
Mail list logo