当课程数为0时,课程列表点击无效

cxt_course
Tim 9 years ago
parent 3493136aab
commit afbf62fd64

@ -94,23 +94,26 @@
$(".syllabus_courses_list").each(function(){ $(".syllabus_courses_list").each(function(){
var syStaust = $(this).children(":first-child"); var syStaust = $(this).children(":first-child");
var classNum = $(this).next().children().children("li").size();
if (syStaust.hasClass("sy_courses_open")){ if(classNum>0){
$(this).toggle(function(){ if (syStaust.hasClass("sy_courses_open")){
$(this).next().hide(); $(this).toggle(function(){
$(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open"); $(this).next().hide();
},function(){ $(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
$(this).next().show(); },function(){
$(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close"); $(this).next().show();
}); $(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
}else{ });
$(this).toggle(function(){ }else{
$(this).next().show(); $(this).toggle(function(){
$(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close"); $(this).next().show();
},function(){ $(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
$(this).next().hide(); },function(){
$(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open"); $(this).next().hide();
}); $(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
});
}
} }
}); });
}); });

Loading…
Cancel
Save