'); } let imgsrc = $(this).attr('src'); index = get_index(imgsrc); window.photoBrowser.init({ lazyLoading: true, lazyLoadingInPrevNext: true, initialSlide: index || 0, maxZoom: 1.8, photos: [ { url: imgArr.join(',') } ] }).open(); }) function get_index(imgsrc){ let index = 0; $.each(imgArr, function(i, v){ if(imgsrc == v){ index = i; } }) return index; } }) } $(function(){ //控制高度 var h=$(window).height(); //屏幕高度 var x=true; $(".burger").css("display","none"); $("#top>div>span").click(function(){ var Htop=$("body").scrollTop(); if(x){ $(this).css("background-position","left top"); $(".burger").show(); document.body.scrollTop=Htop; $("#BOX").css({"height":h+"px","overflow":"hidden"});//使网页不可滚动 $("#BOX").addClass('meunstyle') x= false; }else{ $(this).css("background-position","left bottom"); $(".burger").hide(); document.body.scrollTop=Htop; $("#BOX").css("overflow","initial");//使网页恢复滚动 $("#BOX").removeClass('meunstyle') x= true; if($('#cambrian0').size()>=1){ $('#top').css('top','0') } } }) $(".burger .back button").click(function() { var Htop = $("body").scrollTop(); $("#top>div>span").css("background-position", "center bottom"); $(".burger").hide(); document.body.scrollTop = Htop; $('#BOX').css("overflow", "auto"); //使网页恢复滚动 x = true; }) //更多分类 var n=$(".yxk-cont1 li").length; var a=true; var y=null; //初始化 for(var i=7;i