/* * jQuery Numix Slider - v1.0 * Numix Slider is a jQuery-based carousel that supports infinite number of slided elements with variable widths. * http://example.com * * Made by Gaurav Padia and Asalam Godhaviya * Under GPL License */ !function(a,b){function c(b,c){this.element=b,this.$slider=a(this.element),this.options=a.extend({},i,c),this._defaults=i,this._name=h,this.preload()}var d,e,f,g,h="numixSlider",i={items:"> *",slider:"> *:first",loop:!0,center:!0,infinite:!0,transistion:"easeOutQuad",animationSpeed:800,autoPlay:!1,autoPlayInterval:3e3,autoPlayStopAction:!1,keyboardNav:!1,arrowsNav:!1,arrowsNavHtml:'
',activateOnClick:!0};c.prototype={preload:function(){var c=this;a(b).on("load",function(){c.$slider.parent().find(".nslider-preloader").fadeTo("slow",0,function(){c.$slider.css("visibility","visible"),c.$slider.parent().find(".nslider-controls").css("visibility","visible"),a(this).remove()}),c.init()})},init:function(){var c,e,h,i=this,j=this.$slider.find(this.options.slider),k=j.find(this.options.items),l=this.$slider.width(),m=1;this.$slider.id=this.$slider.attr("id"),"undefined"===this.$slider.id&&(this.$slider.id="nslider_"+this.$slider.index(),this.$slider.attr("id",this.$slider.id)),this.$slider.offset=0,this.$slider.totalSlides=k.length,this.$slider.sliderControlsLinks=this.$slider.parent().find(".nslider-controls > a"),k.each(function(){var b=a(this).width();l>b||i.options.center&&b>l?a(this).find("div.ns-caption").css("maxWidth",b):a(this).find("div.ns-caption").css("maxWidth",l)}),this.$slider.find("div.ns-caption a").on("click touchstart",function(a){a.stopPropagation()}),!this.options.infinite&&this.options.center&&(c=k.filter(":first").width(),k.filter(":first").css("paddingLeft",Math.floor((l-c)/2)),e=k.filter(":last").width(),k.filter(":last").css("paddingRight",Math.floor((l-e)/2))),this.options.infinite||this.options.center||(e=k.filter(":last").width(),k.filter(":last").css("paddingRight",Math.floor(l-e))),k.each(function(){m+=a(this).outerWidth(!0)}),this.options.infinite&&(this.$slider.attr("data-nslider-infinite",!0),m=3*m,k.clone().addClass("-after").insertAfter(k.filter(":last")),k.filter(":first").before(k.clone().addClass("-before")),k=j.find(this.options.items),1===this.$slider.totalSlides&&this.$slider.width(k.filter(":first").width())),j.width(m),this.$slider.items=k,this.$slider.sliderContainer=j,this.$slider.options=this.options,d({},this.$slider,0,0,0),this.$slider.on("nextSlide",function(a){i.preSlideTo(),f(a,i.$slider),i.postSlideTo()}),this.$slider.on("prevSlide",function(a){i.preSlideTo(),g(a,i.$slider),i.postSlideTo()}),this.options.arrowsNav&&this.applyArrowsNav(),this.options.activateOnClick&&(this.$slider.items.mousedown(function(a){h=a.pageX}),this.$slider.items.click(function(a){a.pageX===h&&i.slideTo(i.$slider.items.index(this)),a.preventDefault()})),a(b).resize(function(a){var b=i.$slider.items.filter(".active").index();i.preSlideTo(),d(a,i.$slider,i.$slider.scrollLeft()+Math.floor(i.$slider.items.filter(":eq("+b+")").position().left),b),i.options.autoPlay&&i.autoPlay.start()}),this.autoPlay=a.extend({},this.autoPlay,i),this.options.autoPlay&&(this.autoPlay.enabled=!0,this.autoPlay.start()),this.$slider.sliderControlsLinks.on("click",function(a){a.preventDefault();var b=i.$slider.sliderControlsLinks.index(this),c=i.$slider.sliderControlsLinks.filter(".active").index();b!==c&&i.slideTo(b,a)})},autoPlay:{enabled:!1,interval:null,start:function(){this.interval&&clearInterval(this.interval);var a=this;this.interval=setInterval(function(){f({},a.$slider)},this.$slider.options.autoPlayInterval)},stop:function(){clearInterval(this.interval)}},applyArrowsNav:function(){var a=this;this.$slider.after(this.options.arrowsNavHtml),this.$slider.next().css({width:this.$slider.css("width")}),this.$slider.next().find("a").css({height:this.$slider.css("height"),top:"-"+this.$slider.css("height")}),this.$slider.next().find("a.nslider-arrow-left").on("click",function(b){b.preventDefault(),a.$slider.trigger("prevSlide")}),this.$slider.next().find("a.nslider-arrow-right").on("click",function(b){b.preventDefault(),a.$slider.trigger("nextSlide")})},slideTo:function(a,b){this.preSlideTo();var c,e,f,g=a;this.options.infinite&&a