extraoddsnends
New Member
I have an element filled with div "message" elements and in case there are more than 20 elements I want to fade them slice(20).animate and execute the rest of the code in the finished function of animate, but in case there isn't more than 20 elements I would like to execute the remaining code straight away, how would the logic look in jquery?Sorry for noobish question, I am not that familiar with jquery.EDIT: Here's my code:\[code\]if ($(".info #future>center>div").length<20) {/*Skip straight to bunch of other code*/}$(".info #future>center>div").slice(20).animate({opacity:0}, 500, function(){//Bunch of other code here\[/code\]Now if I just use slice 20 when when there are less than 20 divs in the center element bunch of other code never gets executed.