2 lines
1.1 KiB
JavaScript
2 lines
1.1 KiB
JavaScript
|
(function(){var o,r=0,n=!1;$(document).on("click",".photoli img",function(){if($(this).attr("class")!="videoIcon"){$(".infotypezero").remove();var e='<div class="infotypezero swiper-container" style="display:none;" id="origininfo-img"><div class="swiper-wrapper"></div></div></div>';$("body").append(e),o=new Swiper(".infotypezero",{zoom:!0,width:window.innerWidth,virtual:!0,spaceBetween:20,on:{click:function(){$("#origininfo-img").fadeOut("fast"),this.virtual.slides.length=0,this.virtual.cache=[],n=!1}}});var t=[];$(".photoli img").each(function(c,d){$(this).attr("class")=="videoIcon"||t.push($(this).attr("src"))});var s=$(this).attr("src")||"";for(r=s?t.indexOf(s):0,i=0;i<t.length;i++)o.virtual.appendSlide('<div class="swiper-zoom-container"><img src="'+t[i]+'" /></div>');o.slideTo(r),$("#origininfo-img").fadeIn("fast"),n=!0}}),document.addEventListener("touchstart",function(e){e.touches.length>1&&n&&e.preventDefault()});var a=0;document.addEventListener("touchend",function(e){var t=new Date().getTime();t-a<=300&&e.preventDefault(),a=t},!1),document.addEventListener("touchmove",function(e){n&&e.preventDefault()})})();
|