Hi folks,
I have a simple faq application with the question within a dt tag and
the corresponding answer within a dd tag.
I had hoped that my onload code of:
$('dt.toggle').bind(click,
function(){$(this).parent('dt').next('dd').slideToggle(500);return false;});
would have revealed the
Bruce MacKay schreef:
Hi folks,
I have a simple faq application with the question within a dt tag and
the corresponding answer within a dd tag.
I had hoped that my onload code of:
$('dt.toggle').bind(click,
function(){$(this).parent('dt').next('dd').slideToggle(500);return
false;});
I'll answer my own question this time.
First, make sure you are working with a recent version of
jquery! That is enough to make this one work:
$('a.toggle').bind(click,
function(){$(this).parent('dt').next('dd').slideToggle(500);return false;});
The other approach will work when the
On Feb 20, 2007, at 5:09 AM, Bruce MacKay wrote:
The other approach will work when the .parent('dt') is removed, thus:
$('dt.toggle').css(cursor,pointer).bind(click, function(){$
(this).next('dd').slideToggle(800);return false;});
btw, unlike with the a, you don't need a return false on
need to change the code so that the 'dd' displays open first?
Thanks!
Rick
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Tuesday, February 20, 2007 8:55 AM
To: jQuery Discussion.
Subject: Re: [jQuery] Hide/show question with dl/dt/dd - fixed!
On Feb 20