toggle has been removed since 1.9
toggle has been removed since 1.9 and was available before 1.8.x.
$(function(){ $(".p_title").toggle( function(){ $(this).netx().slideDown(); }, // click once function(){ $(this).netx().slideUp(); }) // click again })
Change to the following way:
$(".p_title").click(function(){ $( ' .c_item ' ).slideUp(); //Hide all subdirectories if ($( this ).next(). is (:visible)) { // Whether is matches :visible display // Meet the condition $( this ).next().slideUp(); // slide up } else { $( this ).next().slideDown(); // slide up } })
optimization:
$(".p_title").click(function(){ $( ' .c_item ' ).slideUp(); // Hide all subdirectories if ($( this ).next(). is (:hidden)) { // whether is matches: visible shows $( this ).next().slideDown(); // slide up } })