arrow.min.js 1.33 KB
N2Require("SmartSliderWidgetArrowImageBar",[],[],function(i,e,s){function t(e,s){this.slider=window[e],this.slider.started(i.proxy(this.start,this,e,s))}return t.prototype.start=function(e,s){if(this.slider.sliderElement.data("arrow"))return!1;if(this.previous=i("#"+e+"-arrow-previous").on("click",i.proxy(function(i){i.stopPropagation(),this.slider[nextend.rtl.previous]()},this)),this.previousImage=this.previous.find(".nextend-arrow-image"),this.next=i("#"+e+"-arrow-next").on("click",i.proxy(function(i){i.stopPropagation(),this.slider[nextend.rtl.next]()},this)),this.nextImage=this.next.find(".nextend-arrow-image"),this.slider.isShuffled){for(var t=[],r=0;r<this.slider.realSlides.length;r++){var n=this.slider.realSlides[r];t.push(s[n.originalIndex])}s=t}this.images=s,this.slider.sliderElement.data("arrow",this).on({sliderSwitchTo:i.proxy(function(i,e){this.onRefresh(e)},this),BeforeVisible:i.proxy(function(){this.onRefresh(this.slider.currentSlide.index)},this)})},t.prototype.onRefresh=function(i){var e=i-1;0>e&&(e=this.slider.slides.length-1);var s=this.slider.slides[e].slides[0].index;this[nextend.rtl.previous+"Image"].css("backgroundImage","url("+this.images[s]+")");var t=i+1;t>=this.slider.slides.length&&(t=0);var r=this.slider.slides[t].slides[0].index;this[nextend.rtl.next+"Image"].css("backgroundImage","url("+this.images[r]+")")},t});