arrow.min.js 3.12 KB
N2Require("SmartSliderWidgetArrowReveal",[],[],function(e,t,i){function s(t,i,s,n){this.size=32,this.animation=i,this.slider=window[t],this.slider.started(e.proxy(this.start,this,t,i,s,n))}return s.prototype.start=function(t,i,s,n){if(this.slider.sliderElement.data("arrow"))return!1;switch(this.previous=e("#"+t+"-arrow-previous").on("click",e.proxy(function(e){e.stopPropagation(),this.slider[nextend.rtl.previous]()},this)),this.previousImage=this.previous.find(".nextend-arrow-image"),this.previousTitle=this.previous.find(".nextend-arrow-title"),this.previous.on({mouseenter:e.proxy(this.mouseEnter,this,this.previous,this.previousImage,this.previousTitle,1),mouseleave:e.proxy(this.mouseLeave,this,this.previous,this.previousImage,this.previousTitle,1)}),this.next=e("#"+t+"-arrow-next").on("click",e.proxy(function(e){e.stopPropagation(),this.slider[nextend.rtl.next]()},this)),this.nextImage=this.next.find(".nextend-arrow-image"),this.nextTitle=this.next.find(".nextend-arrow-title"),i){case"fade":this.previous.css("overflow","hidden"),this.next.css("overflow","hidden");break;case"turn":NextendTween.set(this.previous,{perspective:"1000px"}),NextendTween.set(this.previousImage,{rotationY:90,transformOrigin:"0 0"}),NextendTween.set(this.next,{perspective:"1000px"}),NextendTween.set(this.nextImage,{rotationY:-90,transformOrigin:"100% 0"})}if(this.next.on({mouseenter:e.proxy(this.mouseEnter,this,this.next,this.nextImage,this.nextTitle,-1),mouseleave:e.proxy(this.mouseLeave,this,this.next,this.nextImage,this.nextTitle,-1)}),this.slider.isShuffled){for(var r=[],o=[],a=0;a<this.slider.realSlides.length;a++){var h=this.slider.realSlides[a];r.push(s[h.originalIndex]),o.push(n[h.originalIndex])}s=r,n=o}this.images=s,this.titles=n,this.slider.sliderElement.data("arrow",this).on({sliderSwitchTo:e.proxy(function(e,t){this.onRefresh(t)},this),BeforeVisible:e.proxy(function(){this.onRefresh(this.slider.currentSlide.index)},this)})},s.prototype.onRefresh=function(e){var t=e-1;0>t&&(t=this.slider.slides.length-1);var i=this.slider.slides[t].slides[0].index;this[nextend.rtl.previous+"Image"].css("backgroundImage","url("+this.images[i]+")"),this[nextend.rtl.previous+"Title"].html(this.titles[i]);var s=e+1;s>=this.slider.slides.length&&(s=0);var n=this.slider.slides[s].slides[0].index;this[nextend.rtl.next+"Image"].css("backgroundImage","url("+this.images[n]+")"),this[nextend.rtl.next+"Title"].html(this.titles[n])},s.prototype.mouseEnter=function(e,t,i,s,n){var r=e.data("ssTween");switch(r&&r.pause(),this.animation){case"turn":r=NextendTween.to(t,.4,{rotationY:0,opacity:1});break;case"fade":e.css("overflow","visible"),r=NextendTween.to(t,.4,{opacity:1});break;default:r=new NextendTimeline,r.to(e,.4,{width:t.width()},0),r.to(t,.4,{opacity:1},0)}e.data("ssTween",r)},s.prototype.mouseLeave=function(e,t,i,s,n){var r=e.data("ssTween");switch(r&&r.pause(),this.animation){case"turn":r=NextendTween.to(t,.4,{rotationY:90*s,opacity:0});break;case"fade":r=NextendTween.to(t,.4,{opacity:0}),r.eventCallback("onComplete",function(){e.css("overflow","hidden")});break;default:r=new NextendTimeline,r.to(e,.4,{width:this.size},0),r.to(t,.4,{opacity:0},0)}e.data("ssTween",r)},s});