Jquery specific div selection without using accordian

rexyexpox

New Member
HI,I'm trying to get accordion like functionality without using jQuery's UI accordion feature.How can I select the related (child?) div to open when using a link attached to a \[code\]dt\[/code\] element?At present my code is\[code\]<div id="listings"> <dl class="listings"> <dt> Get the Milk </dt> <dd> Due Date: 17th Oct </dd> <dd> <a href="http://stackoverflow.com/questions/3912656/#" class="more">more details 2</a> </dd> <dd> <a href="http://stackoverflow.com/questions/3912656/#">mark as complete</a> </dd> </dl> <div class="more_details"> <p> This is some details about the task that I would to have appear when the more details 1 link is clicked </p> </div> <dl class="listings"> <dt> Go to Work </dt> <dd> Due Date: 22th Oct </dd> <dd> Site: None </dd> <dd> <a href="http://stackoverflow.com/questions/3912656/#" class="more">more details 2</a> </dd> <dd> <a href="http://stackoverflow.com/questions/3912656/#">mark as complete</a> </dd> </dl> <div class="more_details"> <p> This is some details about the task that I would to have appear when the more details 2 link is clicked </p> </div></div>\[/code\]The jQuery I'm using is \[code\]$('.more').click(function() { $('.more_details').slideToggle('fast', function() { }); return false;});\[/code\]But the problems I have are[*]When the link with class more is clicked, naturally all the more_details divs open[*]The amount of items in the list will vary as they are being generated from a database query so I cant used fixed, unique class namesThanksJz
 
Back
Top