, element) { if($(element).children('li').length == 1){ $(element).hide(); } }); //屏幕滚动时导航透明 $(window).scroll(function(e) { var top = $(document).scrollTop(); if(top > 0){ if($('.nav-layer').css("opacity") != "0.95"){ $('.nav-layer').css("opacity", "0.95"); } }else{ if($('.nav-layer').css("opacity") != "1"){ $('.nav-layer').css("opacity", "1"); } } }); });