$(function () { $(“.change_btn”).click(function () { $(“.change_btn”).css(“background”,”#ffffff00″); $(this).css(“background”,”#ffffff30″); let index = $(“.change_btn”).index($(this)); console.info(index); $(“.change_img”).hide(); $(“.change_img”).eq(index).show(); }); $(“.change_btn_m”).click(function () { $(“.change_btn_m”).css(“background”,”#ffffff00″); $(this).css(“background”,”#ffffff30″); let index = $(“.change_btn_m”).index($(this)); console.info(index); $(“.change_img_m”).hide(); $(“.change_img_m”).eq(index).show(); }) }) < >
$(function () { //2 if (screen.height >= 800 && screen.width >= screen.height) {}else { let Imgs = $(“#ImgModel>div”); let lis = $(“#ImgModel>ul>li”); Imgs.eq(0).remove(); Imgs.eq(4).remove(); Imgs.eq(5).remove(); lis.eq(0).remove(); lis.eq(4).remove(); lis.eq(5).remove(); $(“.showModel1”).remove(); $(“.showModel5”).remove(); $(“.showModel6”).remove(); } let ind=0; $(“#prevImg”).click(function () { ind–; if(ind<0){ ind=($("#ImgModel>ul>li”).length-1); } changeImg(ind); }); $(“#nextImg”).click(function () { ind++; if(ind>($(“#ImgModel>ul>li”).length-1)){ ind=0; } changeImg(ind); }); $(“#ImgModel>ul>li”).click(function () { let li = $(this); ind = $(“#ImgModel>ul>li”).index(li); changeImg(ind); }); // function changeImg(index){ $(“#ImgModel>div”).hide(); $(“#ImgModel>div”).eq(index).show(); } // $(“.showModel”).click(function () { $(“#ModelBox”).fadeIn(300); let span = $(this); ind = $(“.showModel”).index(span); changeImg(ind); }); //esc $(document).keyup(function(event) { switch (event.keyCode) { case 27: $(“#ModelBox”).fadeOut(300); } }) })
Reviews
There are no reviews yet.