2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
|
(function(Y,j){var U={init:function(){var m=this;m.isIE=m.IEVersion(!1);for(var g=Y(".module[data-type=carousel]"),p=0,c=g.length;p<c;p++)m.richCarouselEvent(g.eq(p),p)},IEVersion:function(m){var g=navigator.userAgent,p=g.indexOf("compatible")>-1&&g.indexOf("MSIE")>-1,c=g.indexOf("Edge")>-1&&!p,o=g.indexOf("Trident")>-1&&g.indexOf("rv:11.0")>-1;return p||c||o?!0:m},richCarouselEvent:function(m,g){m.html(""),m.append('<div class="screenBox"></div>');var p=this,c=m,o=c.attr("data-canousel")?Y.parseJSON(c.attr("data-canousel")):!1,k=c.find(".screenBox"),X=c.find(".img_ul"),u=c.width(),_=c.height(),J=Y(window),E,Q;if(!o)return!1;var T=o.checkedList,O=T.length<1?["fadeIn"]:T,B=O.length;E={init:function(){this.d=o.list,this.s=o.playTime,this.t=o.changeTime,this.sh=!1,this.renders(),this.nav(),this.timing(),this.canouselEvent()},renders:function(){var a=this,r=this.d,e=this.sh;this.imgLi=c.find(".img_li"),this.imgLi.hide(),this.imgLi.eq(0).show(),this.imgTitle=c.find(".img_title"),k.append('<a class="canvasHref" href=""><div class="canvasBox" style="pointer-events: auto;transform: translate(-50%, 0);-ms-transform: translate(-50%, 0);-moz-transform: translate(-50%, 0); -webkit-transform: translate(-50%, 0);-o-transform: translate(-50%, 0);"></div></a>'),this.index=0,a.navHref(),this.index=r.length<2?0:1,this.preIndex=this.index<1?a.d.length-1:this.index-1,this.cBox=k.find(".canvasBox"),this.changes()},changes:function(a){var r=this,e="fadeIn";if(B>0){var s=parseInt(B*Math.random());e=O[s]}p.isIE&&e=="3DEffect"&&(e="fadeIn"),this.renderFrames(e,a)},renderFrames:function(a,r){var e=this,s="",h=e.d[e.preIndex],l=e.d[e.index],b=this.t,n={duration:function(t){var i="transition-duration:"+t+"s; -moz-transition-duration: "+t+"s; -webkit-transition-duration:"+t+"s;-o-transition-duration:"+t+"s;";return i},delays:function(t){var i="transition-delay:"+t+"s; -moz-transition-delay: "+t+"s; -webkit-transition-delay:"+t+"s;-o-transition-delay:"+t+"s;";return i},rotateX:function(t){var i="transform:rotateX("+t+"deg);-ms-transform:rotateX("+t+"deg);-webkit-transform:rotateX("+t+"deg);";return i},rotateY:function(t){var i="transform:rotateY("+t+"deg);-ms-transform:rotateY("+t+"deg);-webkit-transform:rotateY("+t+"deg);";return i},rotateXYZ:function(t,i,d){var W="transform:rotateX("+t+"deg) rotateY("+i+"deg) translateZ("+d+"px);-ms-transform:rotateX("+t+"deg) rotateY("+i+"deg) translateZ("+d+"px);-webkit-transform:rotateX("+t+"deg) rotateY("+i+"deg) translateZ("+d+"px);";return W},translateY:function(t){var i="transform:translateY("+t+");-ms-transform:translateY("+t+");-webkit-transform:translateY("+t+");";return i},translate:function(t,i){var d="transform:translate("+t+","+i+");-ms-transform:translate("+t+","+i+");-webkit-transform:translate("+t+","+i+");";return d},shadesBgImage:function(t,i){var d;return o.adapt=="pp"?d="background:url("+l.src+") -"+i*t+"px 0;":o.adapt=="ls"?d="background-image:url("+l.src+"); background-position: -"+i*t+"px center;background-size:"+u+"px "+_+"px;":d="background-image:url("+l.src+"); background-position: -"+i*t+"px center;background-size:"+u+"px auto;",d},href:function(t){var i="";if(t.href){var d=t.href;d.indexOf("/aroom/#")>-1||d.indexOf("/myroom/#")>-1||d.indexOf("/pay/#")>-1?i='clickUrl="'+h.href+'"':i='href="'+d+'" target="'+t.target+'"'}return i}},L=b/40,P=b/2,y=parseInt(u/20),q=u-y*19,C="";switch(a){case"fadeIn":for(var v=0,A=e.d.length;v<A;v++){var H=e.d[v];v==0?s+='<div class="img_li '+o.adapt+'" style="width:'+u+"px;min-width:100%;opacity:1;"+n.duration(b)+"background-image:url("+H.path+');"></div>':s+='<div class="img_li '+o.adapt+'" style="width:'+u+"px;min-width:100%;opacity:0;"+n.duration(b)+"background-image:url("+H.path+');"></div>'}e.coverType=="fadeIn"&&(s=""),e.coverType="fadeIn";break;case"shades":e.coverType="fadeIn",this.cBox.css("overflow","hidden");var N=Math.random()>.5,M=N?function(t,i){return t}:function(t,i){var d=i-1;return d-t},S=parseInt(4*Math.random());switch(S){case 0:mode=N?n.rotateY("-90"):n.rotateY("90");break;case 1:mode=function(t){return t%2==0?n.translateY("-100%"):n.tr
|