✦ Verified product
Footrest Series GT505F
USD 129.99
GTPlayer Gaming Chair US
Verified independent store
→
$(function () { $(".change_btn").click(function () { $(".change_btn").css("background","#ffffff00"); $(this).css("background","#ffffff30"); let index = $(".change_btn").index($(thi
s)); 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 () { //手机端删除第一张和最后一张图 if (screen.height >= 800 && screen.width >= screen.height) {}else { let Imgs = $("#ImgModel>div"); let lis = $("#ImgModel>ul>li"); Imgs.eq(3).remove(); Imgs.eq(4).remove(); Imgs.eq(5).remove(); lis.eq(3).remove(); lis.eq(4).remove(); lis.eq(5).remove(); $(".showModel4").remove(); $(".showModel5").remove(); $(".showModel6").remove(); } let ind=0; $("#prevImg").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); } }) }) $(function () { //去掉各端口多余的动画 if(screen.height >= 800 && screen.width >= screen.height){ $(".dw.phA").remove(); }else { $(".dw.pcA").remove(); } })