javascript - how to make slidetoggle with jquery? -
i trying use slide-toggle effect of j-query getting issue html have . please take -:
<li class="active sub-tag">pork ham</li> <li class="active-in active"><a onclick="call_content(146);" href="#">> double smoked ham</a></li> <li class="active-in active"><a onclick="call_content(147);" href="#">> prime ham</a></li> <li class="active-in active"><a onclick="call_content(148);" href="#">> smoked ham</a></li> <li class="active sub-tag">pork lyoner</li> <li class="active-in active"><a onclick="call_content(149);" href="#">> pork olive lyoner</a></li> <li class="active-in active"><a onclick="call_content(150);" href="#">> pork paprica lyoner</a></li> <li class="active-in active"><a onclick="call_content(151);" href="#">> pork pepper lyoner</a></li> <li class="active-in active"><a onclick="call_content(152);" href="#">> pork pista lyoner</a></li> <li class="active sub-tag">pepperoni</li> <li class="active-in active"><a onclick="call_content(153);" href="#">> pork pepperoni</a></li>
i want show toggle effect on pork ham , pork lyoner , pepperoni.
advise me how without changing html , classes.
this how did it:
$('.sub-tag').click(function(){ var current = $(this); while(current.next().hasclass('active-in') != false){ current = current.next(); current.slidetoggle(); } });
Comments
Post a Comment