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

This commit is contained in:
Tim 2016-07-01 17:02:52 +08:00
parent 3493136aab
commit afbf62fd64
1 changed files with 19 additions and 16 deletions

View File

@ -94,7 +94,9 @@
$(".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(classNum>0){
if (syStaust.hasClass("sy_courses_open")){ if (syStaust.hasClass("sy_courses_open")){
$(this).toggle(function(){ $(this).toggle(function(){
$(this).next().hide(); $(this).next().hide();
@ -112,6 +114,7 @@
$(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open"); $(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
}); });
} }
}
}); });
}); });
</script> </script>