not able to remove nested lists in a jQuery variable
Posted
by Pradyut Bhattacharya
on Stack Overflow
See other posts from Stack Overflow
or by Pradyut Bhattacharya
Published on 2010-03-09T10:02:46Z
Indexed on
2010/03/09
10:06 UTC
Read the original article
Hit count: 708
Hi
I have a nested oredered list which i m animating using this code...
var $li = $("ol#update li");
function animate_li(){
$li.filter(':first')
.animate({
height: 'show',
opacity: 'show'
}, 500, function(){
animate_li();
});
$li = $li.not(':first');
}
animate_li();
now i want not to show or animate the nested lists(ol s) or the li s in the ols
take a look at the example here
The structure of my ols are
<ol>
<li class="bar248">
<div class="nli">
<div class="pic">
<img src="dir/anonymous-thumb.png"alt="image" />
</div>
<div align="left" class="text">
<span>
<span class="delete_button"><a href="#" id="test" class="delete_update">R</a></span>
test shouted <span class="timestamp"> 2010/02/24 18:34:26 </span> <br />
this
</span>
</div>
<div class="clear"></div>
</div>
<div class="padd">
</div>
<ol class="comment">
<li>
<div>Testing </div>
</li>
<li>
<div>Another Test </div>
</li>
</ol>
</li>
</ol>
I m able to hide the nested ols using this code...
$("ol#update li ol").hide();
But still time is being consumed in animating them although they are hidden
I m not able to remove the nested li s using this code
var $li = $("ol#update li").not("ol#update li ol");
$li = $li.not("ol#update li ol");
Take a look at this here
Any help
thanks < br> Pradyut
© Stack Overflow or respective owner