Return to Snippet

Revision: 24035
at February 19, 2010 05:43 by daulex


Initial Code
$("li.par_cat").click(function() {
	var el_count = $(this).nextUntil("li.par_cat").size();
	if(el_count == 0){
		// I'll add something here later.
	}else{
	$(this).nextUntil("li.par_cat").each(function() {
		$(this).slideToggle("slow");
	});
	return false;
	}
});

Initial URL

                                

Initial Description
Catches click, if element has nextUntil elements, triggers a slideDown of child elements and returns false (to stop the anchor), if there are no nextUntil elements, does nothing and allows the click through (the anchor works).

Initial Title
jQuery  find li elements until, if has nextUntil elements

Initial Tags
jquery

Initial Language
jQuery