slick-carousel
Advanced tools
Comparing version 1.2.9 to 1.2.10
{ | ||
"name": "slick-carousel", | ||
"main": "slick.js", | ||
"version": "1.2.9", | ||
"main": "js/slick.js", | ||
"version": "1.2.10", | ||
"homepage": "https://github.com/kenwheeler/slick", | ||
@@ -22,4 +22,3 @@ "authors": [ | ||
"tests", | ||
"index.html", | ||
"fonts" | ||
"index.html" | ||
], | ||
@@ -26,0 +25,0 @@ "dependencies": { |
@@ -16,2 +16,8 @@ $(document).ready(function(){ | ||
}); | ||
$('.vertical').slick({ | ||
dots: true, | ||
infinite: true, | ||
speed: 300, | ||
vertical: true | ||
}); | ||
$('.one-time').slick({ | ||
@@ -45,5 +51,3 @@ dots: false, | ||
infinite: true, | ||
dots: true, | ||
fade: true, | ||
speed: 600 | ||
dots: true | ||
} | ||
@@ -78,2 +82,11 @@ }, | ||
$('.fade').slick({ | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
fade: true, | ||
slide: '.multiple', | ||
cssEase: 'linear' | ||
}); | ||
$('.add-remove').slick({ | ||
@@ -80,0 +93,0 @@ dots: true, |
178
js/slick.js
@@ -58,3 +58,4 @@ /* | ||
touchMove: true, | ||
touchThreshold: 5 | ||
touchThreshold: 5, | ||
vertical: false | ||
}; | ||
@@ -70,2 +71,3 @@ | ||
listWidth : null, | ||
listHeight : null, | ||
loadIndex : 0, | ||
@@ -263,3 +265,7 @@ nextArrow : null, | ||
transition = 'all ' + _.options.speed + 'ms ' + _.options.cssEase; | ||
origin = (_.listWidth / 2) + ' 50%'; | ||
if (_.options.vertical === false) { | ||
origin = (_.listWidth / 2) + ' 50%'; | ||
} else { | ||
origin = ''; | ||
} | ||
@@ -514,2 +520,3 @@ if (_.options.fade === false) { | ||
_.listWidth = _.list.width(); | ||
_.listHeight = _.list.height(); | ||
_.slideWidth = Math.ceil(_.listWidth / _.options | ||
@@ -605,3 +612,3 @@ .slidesToShow); | ||
if(_.options.fade === true) { | ||
if(_.options.fade === true || _.options.vertical === true) { | ||
_.options.slidesToShow = 1; | ||
@@ -672,4 +679,9 @@ _.options.slidesToScroll = 1; | ||
_.list.find('.slick-slide').width(_.slideWidth); | ||
_.slideTrack.width(Math.ceil((_.slideWidth * _ | ||
.slider.find('.slick-slide').length))); | ||
if (_.options.vertical === false) { | ||
_.slideTrack.width(Math.ceil((_.slideWidth * _ | ||
.slider.find('.slick-slide').length))); | ||
} else { | ||
_.slideTrack.height(Math.ceil((_.listHeight * _ | ||
.slider.find('.slick-slide').length))); | ||
} | ||
@@ -680,3 +692,3 @@ }; | ||
var _ = this, targetLeft; | ||
var _ = this, targetLeft, targetTop; | ||
@@ -691,6 +703,11 @@ _.setValues(); | ||
if (_.options.fade === false) { | ||
targetLeft = ((_.currentSlide * | ||
_.slideWidth) * -1) + _.slideOffset; | ||
_.setLeft(targetLeft); | ||
if (_.options.vertical === false) { | ||
targetLeft = ((_.currentSlide * | ||
_.slideWidth) * -1) + _.slideOffset; | ||
_.setLeft(targetLeft); | ||
} else { | ||
targetTop = ((_.currentSlide * | ||
_.listHeight) * -1) - _.listHeight; | ||
_.setTop(targetTop); | ||
} | ||
} else { | ||
@@ -882,3 +899,3 @@ _.setFade(); | ||
$(_.slides.get(slideIndex)).css({zIndex: 999}); | ||
$(_.slides.get(slideIndex)).css({zIndex: 1000}); | ||
@@ -891,8 +908,7 @@ $(_.slides.get(slideIndex)).animate({ | ||
$(_.slides.get(slideIndex)).css({zIndex: 999}); | ||
_.applyTransition(slideIndex); | ||
$(_.slides.get(slideIndex)).css({ | ||
opacity: 1 | ||
opacity: 1, | ||
zIndex: 1000 | ||
}); | ||
@@ -923,7 +939,12 @@ | ||
if (_.transformsEnabled === false) { | ||
if (_.options.vertical === false) { | ||
_.slideTrack.animate({ | ||
left: targetLeft | ||
}, _.options.speed,_.options.easing, callback); | ||
} else { | ||
_.slideTrack.animate({ | ||
top: targetLeft | ||
}, _.options.speed,_.options.easing, callback); | ||
} | ||
_.slideTrack.animate({ | ||
left: targetLeft | ||
}, _.options.speed,_.options.easing, callback); | ||
} else { | ||
@@ -941,5 +962,11 @@ | ||
step: function (now) { | ||
animProps[_.animType] = "translate(" + | ||
now + "px, 0px)"; | ||
_.slideTrack.css(animProps); | ||
if (_.options.vertical === false) { | ||
animProps[_.animType] = "translate(" + | ||
now + "px, 0px)"; | ||
_.slideTrack.css(animProps); | ||
} else { | ||
animProps[_.animType] = "translate(0px," + | ||
now + "px,0px)"; | ||
_.slideTrack.css(animProps); | ||
} | ||
}, | ||
@@ -957,3 +984,7 @@ complete: function () { | ||
animProps[_.animType] = "translate3d(" + targetLeft + "px, 0px, 0px)"; | ||
if (_.options.vertical === false) { | ||
animProps[_.animType] = "translate3d(" + targetLeft + "px, 0px, 0px)"; | ||
} else { | ||
animProps[_.animType] = "translate3d(0px," + targetLeft + "px, 0px)"; | ||
} | ||
_.slideTrack.css(animProps); | ||
@@ -1021,6 +1052,13 @@ | ||
targetSlide = index; | ||
targetLeft = ((targetSlide * _.slideWidth) * -1) + | ||
_.slideOffset; | ||
slideLeft = ((_.currentSlide * _.slideWidth) * -1) + | ||
_.slideOffset; | ||
if(_.options.vertical === false) { | ||
targetLeft = ((targetSlide * _.slideWidth) * -1) + | ||
_.slideOffset; | ||
slideLeft = ((_.currentSlide * _.slideWidth) * -1) + | ||
_.slideOffset; | ||
} else { | ||
targetLeft = ((targetSlide * _.listHeight) * -1) - | ||
_.listHeight; | ||
slideLeft = ((_.currentSlide * _.listHeight) * -1) - | ||
_.listHeight; | ||
} | ||
@@ -1041,2 +1079,4 @@ if (_.options.autoplay === true) { | ||
_.animating = true; | ||
_.fadeSlide(_.slideCount - 1, function(){ | ||
@@ -1071,2 +1111,5 @@ _.postSlide(_.slideCount - 1); | ||
if (_.options.fade === true) { | ||
_.animating = true; | ||
_.fadeSlide(0, function(){ | ||
@@ -1101,2 +1144,5 @@ _.postSlide(0); | ||
if (_.options.fade === true) { | ||
_.animating = true; | ||
_.fadeSlide(targetSlide, function(){ | ||
@@ -1118,2 +1164,39 @@ _.postSlide(targetSlide); | ||
Slick.prototype.setTop = function (newTop) { | ||
var _ = this, animProps = {}; | ||
_.slideTrack.css({ | ||
'position': 'absolute', | ||
'display' : 'block' | ||
}); | ||
_.slideTrack.find(_.options.slide).css({ | ||
'height': 'auto', | ||
'display': 'block', | ||
'float': 'none', | ||
'border' : '1px solid transparent' | ||
}); | ||
_.list.height(_.slides.first().outerHeight()); | ||
if (_.transformsEnabled === | ||
false) { | ||
_.slideTrack.css('top', | ||
newTop); | ||
} else { | ||
if(_.cssTransitions === false) { | ||
animProps[_.animType] = | ||
"translate(0px, " + newTop + "px)"; | ||
_.slideTrack.css(animProps); | ||
} else { | ||
animProps[_.animType] = | ||
"translate3d(0px, " + newTop + | ||
"px, 0px)"; | ||
_.slideTrack.css(animProps); | ||
} | ||
} | ||
}; | ||
Slick.prototype.setLeft = function (newLeft) { | ||
@@ -1178,6 +1261,10 @@ | ||
touches = event.originalEvent.touches; | ||
if (_.options.vertical === false) { | ||
curLeft = ((_.currentSlide * _.slideWidth) * -1) + | ||
_.slideOffset; | ||
} else { | ||
curLeft = ((_.currentSlide * _.listHeight) * -1) - | ||
_.listHeight; | ||
} | ||
curLeft = ((_.currentSlide * _.slideWidth) * -1) + | ||
_.slideOffset; | ||
if ((touches && touches.length === 1) || event. | ||
@@ -1199,4 +1286,3 @@ data.kind ==='drag') { | ||
if (_.swipeDirection() !== 'up' && _.swipeDirection() !== | ||
'down' && _.options.touchMove === true && | ||
_.options.fade === false) { | ||
'down' && _.options.touchMove === true) { | ||
@@ -1206,13 +1292,23 @@ event.originalEvent.preventDefault(); | ||
if (_.touchObject.curX > _.touchObject | ||
.startX) { | ||
.startX && _.options.fade === false) { | ||
_.setLeft(curLeft + _.touchObject | ||
.swipeLength); | ||
if(_.options.vertical === false) { | ||
_.setLeft(curLeft + _.touchObject | ||
.swipeLength); | ||
} else { | ||
_.setTop(curLeft + (_.touchObject | ||
.swipeLength * (_.listHeight / _.listWidth))); | ||
} | ||
_.swipeLeft = newLeft; | ||
} else { | ||
} else if(_.options.fade === false){ | ||
_.setLeft(curLeft - _.touchObject | ||
.swipeLength); | ||
if(_.options.vertical === false) { | ||
_.setLeft(curLeft - _.touchObject | ||
.swipeLength); | ||
} else { | ||
_.setTop(curLeft - (_.touchObject | ||
.swipeLength * (_.listHeight / _.listWidth))); | ||
} | ||
@@ -1265,4 +1361,6 @@ _.swipeLeft = newLeft; | ||
_.slideHandler(_.currentSlide); | ||
_.touchObject = {}; | ||
if(_.options.fade === false) { | ||
_.slideHandler(_.currentSlide); | ||
_.touchObject = {}; | ||
} | ||
@@ -1289,3 +1387,3 @@ } | ||
if (_.touchObject.startX) { | ||
if (_.touchObject.startX && _.options.fade === false) { | ||
_.slideHandler(_.currentSlide); | ||
@@ -1292,0 +1390,0 @@ _.touchObject = {}; |
@@ -1,1 +0,1 @@ | ||
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";var c,b=window.Slick||{};c=function(a,b){return function(){return a.apply(b,arguments)}},b=function(){function b(b,d){var f,g,e=this;if(e.defaults={accessibility:!0,autoplay:!1,autoplaySpeed:3e3,cssEase:"ease",dots:!1,draggable:!0,fade:!1,easing:"linear",arrows:!0,infinite:!0,onBeforeChange:null,onAfterChange:null,pauseOnHover:!0,responsive:null,slide:"div",slidesToShow:1,slidesToScroll:1,speed:300,swipe:!0,touchMove:!0,touchThreshold:5},e.initials={animating:!1,autoPlayTimer:null,currentSlide:0,currentLeft:null,direction:1,dots:null,listWidth:null,loadIndex:0,nextArrow:null,prevArrow:null,slideCount:null,slideWidth:null,slideTrack:null,slides:null,sliding:!1,slideOffset:0,swipeLeft:null,list:null,touchObject:{},transformsEnabled:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.breakpoints=[],e.breakpointSettings=[],e.slider=a(b),e.slidesCache=null,e.cssTransitions=!1,e.options=a.extend({},e.defaults,d),e.originalSettings=e.options,f=e.options.responsive||null,f&&f.length>-1){for(g in f)f.hasOwnProperty(g)&&(e.breakpoints.push(f[g].breakpoint),e.breakpointSettings[f[g].breakpoint]=f[g].settings);e.breakpoints.sort(function(a,b){return b-a})}e.autoPlay=c(e.autoPlay,e),e.autoPlayClear=c(e.autoPlayClear,e),e.changeSlide=c(e.changeSlide,e),e.setPosition=c(e.setPosition,e),e.swipeHandler=c(e.swipeHandler,e),e.dragHandler=c(e.dragHandler,e),e.keyHandler=c(e.keyHandler,e),e.autoPlayIterator=c(e.autoPlayIterator,e),e.init()}return b}(),b.prototype.init=function(){var b=this;a(b.slider).hasClass("slick-initialized")||(a(b.slider).addClass("slick-initialized"),b.buildOut(),b.getAnimType(),b.checkTransition(),b.startLoad(),b.loadSlider(),b.initializeEvents(),b.checkResponsive())},b.prototype.addSlide=function(b){var c=this;c.unload(),a(b).appendTo(c.slideTrack),c.slides=c.slideTrack.find(this.options.slide),c.slideTrack.find(this.options.slide).remove(),c.slideTrack.append(c.slides),c.reinit()},b.prototype.removeSlide=function(b){var c=this;return c.unload(),c.slideCount<1?!1:(a(c.slideTrack.find(this.options.slide).get(b)).remove(),c.slides=c.slideTrack.find(this.options.slide),c.slideTrack.find(this.options.slide).remove(),c.slideTrack.append(c.slides),c.reinit(),void 0)},b.prototype.filterSlides=function(a){var b=this;null!==a&&(b.unload(),b.slideTrack.find(this.options.slide).remove(),b.slidesCache.filter(a).appendTo(b.slideTrack),b.reinit())},b.prototype.unfilterSlides=function(){var a=this;null!==a.slidesCache&&(a.unload(),a.slideTrack.find(this.options.slide).remove(),a.slidesCache.appendTo(a.slideTrack),a.reinit())},b.prototype.checkTransition=function(){var a=this;void 0!==document.body.style.WebkitTransition?a.cssTransitions=!0:void 0!==document.body.style.MozTransition?a.cssTransitions=!0:void 0!==document.body.style.msTransition&&(a.cssTransitions=!0)},b.prototype.applyTransition=function(b){var d,e,c=this;d="all "+c.options.speed+"ms "+c.options.cssEase,e=c.listWidth/2+" 50%",c.options.fade===!1?c.slideTrack.css({transition:d,transformOrigin:e}):a(c.slides.get(b)).css({transition:d})},b.prototype.disableTransition=function(b){var c=this;c.options.fade===!1?c.slideTrack.css({transition:"",transformOrigin:""}):a(c.slides.get(b)).css({transition:""})},b.prototype.getAnimType=function(){var a=this;void 0!==document.body.style.MozTransform?a.animType="MozTransform":void 0!==document.body.style.webkitTransform?a.animType="webkitTransform":void 0!==document.body.style.msTransform&&(a.animType="msTransform"),null!==a.animType&&(a.transformsEnabled=!0)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed)},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(0===a.currentSlide-1&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.checkResponsive=function(){var c,d,b=this;if(b.originalSettings.responsive&&b.originalSettings.responsive.length>-1){d=null;for(c in b.breakpoints)b.breakpoints.hasOwnProperty(c)&&a(window).width()<b.breakpoints[c]&&(d=b.breakpoints[c]);null!==d?null!==b.activeBreakpoint?d!==b.activeBreakpoint&&(b.activeBreakpoint=d,b.options=a.extend({},b.defaults,b.breakpointSettings[d]),b.refresh()):(b.activeBreakpoint=d,b.options=a.extend({},b.defaults,b.breakpointSettings[d]),b.refresh()):null!==b.activeBreakpoint&&(b.activeBreakpoint=null,b.options=a.extend({},b.defaults,b.originalSettings),b.refresh())}},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.prevArrow.hide(),a.nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.dots.hide(),a.slider.addClass("slick-loading")},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.prevArrow.show(),a.nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.loadSlider=function(){var b=this;b.setPosition(),b.slideTrack.css({opacity:1}),"complete"!==document.readyState?a(window).load(function(){b.slider.removeClass("slick-loading"),b.initUI()}):(b.slider.removeClass("slick-loading"),b.initUI())},b.prototype.setValues=function(){var a=this;a.listWidth=a.list.width(),a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.prevArrow=a('<a href="javascript:void(0)" tabIndex="-1">Previous</a>').appendTo(b.slider).addClass("slick-prev"),b.nextArrow=a('<a href="javascript:void(0)" tabIndex="-1">Next</a>').appendTo(b.slider).addClass("slick-next"),b.options.infinite!==!0&&b.prevArrow.addClass("slick-disabled"))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='<ul class="slick-dots">',c=1;c<=b.slideCount;c+=1)d+='<li><a href="javascript:void(0)" tabIndex="-1">'+c+"</a></li>";if(d+="</ul>",b.dots=a(d).appendTo(b.slider),b.options.slidesToScroll>1)for(b.dots.find("li").hide(),c=0;c<b.slideCount;)a(b.dots.find("li").get(c)).show(),c+=b.options.slidesToScroll;b.dots.find("li").first().addClass("slick-active")}},b.prototype.setupInfinite=function(){var c,d,b=this;if(b.options.infinite===!0&&b.options.fade===!1){for(d=null,c=b.slideCount;c>b.slideCount-b.options.slidesToShow;c-=1)d=c-1,a(b.slides[d]).clone().prependTo(b.slideTrack).addClass("slick-cloned");for(c=0;c<b.options.slidesToShow;c+=1)d=c,a(b.slides[d]).clone().appendTo(b.slideTrack).addClass("slick-cloned")}},b.prototype.setupPlaceholders=function(){var c,d,b=this;if(b.options.fade===!0&&(b.options.slidesToShow=1,b.options.slidesToScroll=1),0!==b.slideCount%b.options.slidesToScroll&&1!==b.options.slidesToShow){for(d=Math.abs(b.options.slidesToScroll-b.slideCount%b.options.slidesToScroll),c=0;d>c;c+=1)a("<div/>").appendTo(b.slideTrack).addClass("slick-slide slick-placeholder");b.slides=a(".slick-slide:not(.slick-cloned)",b.slider),b.slideCount=b.slides.length}},b.prototype.buildOut=function(){var b=this;b.slides=a(b.options.slide+":not(.slick-cloned)",b.slider).addClass("slick-slide"),b.slideCount=b.slides.length,b.slidesCache=b.slides,b.slider.addClass("slick-slider"),b.slideTrack=b.slides.wrapAll('<div class="slick-track"/>').parent(),b.list=b.slideTrack.wrap('<div class="slick-list"/>').parent(),b.slideTrack.css("opacity",0),b.options.accessibility===!0&&b.list.prop("tabIndex",0),b.setupPlaceholders(),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.setSlideClasses(0),b.options.draggable===!0&&b.list.addClass("draggable")},b.prototype.setDimensions=function(){var a=this;a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.list.find(".slick-slide").width(a.slideWidth),a.slideTrack.width(Math.ceil(a.slideWidth*a.slider.find(".slick-slide").length))},b.prototype.setPosition=function(){var b,a=this;a.setValues(),a.setDimensions(),a.options.infinite===!0&&(a.slideOffset=-1*a.slideWidth*a.options.slidesToShow),a.options.fade===!1?(b=-1*a.currentSlide*a.slideWidth+a.slideOffset,a.setLeft(b)):a.setFade()},b.prototype.setFade=function(){var c,b=this;b.slides.each(function(d,e){c=-1*b.slideWidth*d,a(e).css({position:"relative",left:c,top:0,zIndex:800,opacity:0})}),a(b.slides.get(b.currentSlide)).css({zIndex:900,opacity:1})},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li a",b.dots).on("click.slick",{message:"index"},b.changeSlide)},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.options.swipe===!0&&(b.list.on("touchstart.slick",{action:"start",kind:"touch"},b.swipeHandler),b.list.on("touchmove.slick",{action:"move",kind:"touch"},b.swipeHandler),b.list.on("touchend.slick",{action:"end",kind:"touch"},b.swipeHandler),b.list.on("touchcancel.slick",{action:"end",kind:"touch"},b.swipeHandler)),b.options.draggable===!0&&(b.list.on("mousedown.slick",{action:"start",kind:"drag"},b.swipeHandler),b.list.on("mousemove.slick",{action:"move",kind:"drag"},b.swipeHandler),b.list.on("mouseup.slick",{action:"end",kind:"drag"},b.swipeHandler),b.list.on("mouseleave.slick",{action:"cancel",kind:"drag"},b.swipeHandler)),b.options.pauseOnHover===!0&&b.options.autoplay===!0&&(b.list.on("mouseenter.slick",b.autoPlayClear),b.list.on("mouseleave.slick",b.autoPlay)),b.list.on("keydown.slick",b.keyHandler),a(window).on("orientationchange.slick",b.setPosition),a(window).on("resize.slick",function(){b.checkResponsive(),b.setPosition()}),a(window).on("load.slick",b.setPosition)},b.prototype.changeSlide=function(b){var c=this;switch(b.data.message){case"previous":c.slideHandler(c.currentSlide-c.options.slidesToScroll);break;case"next":c.slideHandler(c.currentSlide+c.options.slidesToScroll);break;case"index":c.slideHandler(a(b.target).parent().index());break;default:return!1}},b.prototype.updateDots=function(){var b=this;null!==b.dots&&(b.dots.find("li").removeClass("slick-active"),a(b.dots.find("li").get(b.currentSlide)).addClass("slick-active"))},b.prototype.updateArrows=function(){var a=this;a.options.arrows===!0&&a.options.infinite!==!0&&a.slideCount>a.options.slidesToShow&&(0===a.currentSlide?(a.prevArrow.addClass("slick-disabled"),a.nextArrow.removeClass("slick-disabled")):a.currentSlide>=a.slideCount/a.options.slidesToScroll*a.options.slidesToShow-a.options.slidesToScroll?(a.nextArrow.addClass("slick-disabled"),a.prevArrow.removeClass("slick-disabled")):(a.prevArrow.removeClass("slick-disabled"),a.nextArrow.removeClass("slick-disabled")))},b.prototype.fadeSlide=function(b,c){var d=this;d.cssTransitions===!1?(a(d.slides.get(b)).css({zIndex:999}),a(d.slides.get(b)).animate({opacity:1},d.options.speed,d.options.easing,c)):(a(d.slides.get(b)).css({zIndex:999}),d.applyTransition(b),a(d.slides.get(b)).css({opacity:1}),c&&setTimeout(function(){d.disableTransition(b),c.call()},d.options.speed))},b.prototype.animateSlide=function(b,c){var d={},e=this;null!==e.options.onBeforeChange&&e.options.onBeforeChange.call(),e.transformsEnabled===!1?e.slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){d[e.animType]="translate("+a+"px, 0px)",e.slideTrack.css(d)},complete:function(){c&&c.call()}}):(e.applyTransition(),d[e.animType]="translate3d("+b+"px, 0px, 0px)",e.slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.setSlideClasses=function(b){var c=this;c.slides.removeClass("slick-active"),a(c.slides.get(b)).addClass("slick-active")},b.prototype.postSlide=function(a){var b=this;b.animating=!1,b.currentSlide=a,b.setPosition(),b.swipeLeft=null,b.updateDots(),b.updateArrows(),b.options.autoplay===!0&&b.autoPlay(),null!==b.options.onAfterChange&&b.options.onAfterChange.call(),b.setSlideClasses(b.currentSlide)},b.prototype.slideHandler=function(a){var b,c,d=null,e=this;if(e.animating===!0)return!1;if(b=a,d=-1*b*e.slideWidth+e.slideOffset,c=-1*e.currentSlide*e.slideWidth+e.slideOffset,e.options.autoplay===!0&&clearInterval(e.autoPlayTimer),e.currentLeft=null===e.swipeLeft?c:e.swipeLeft,0>b){if(e.options.fade===!0)return e.fadeSlide(e.slideCount-1,function(){e.postSlide(e.slideCount-1)}),!1;if(e.options.infinite!==!0)return e.animateSlide(c),!1;e.animating=!0,e.animateSlide(d,function(){e.postSlide(e.slideCount-e.options.slidesToScroll)})}else if(b>e.slideCount-1){if(e.options.fade===!0)return e.fadeSlide(0,function(){e.postSlide(0)}),!1;if(e.options.infinite!==!0)return e.animateSlide(c),!1;e.animating=!0,e.animateSlide(d,function(){e.postSlide(0)})}else{if(e.animating=!0,e.options.fade===!0)return e.fadeSlide(b,function(){e.postSlide(b)}),!1;e.animateSlide(d,function(){e.postSlide(b)})}},b.prototype.setLeft=function(a){var b=this,c={};b.transformsEnabled===!1?b.slideTrack.css("left",a):b.cssTransitions===!1?(c[b.animType]="translate("+a+"px, 0px)",b.slideTrack.css(c)):(c[b.animType]="translate3d("+a+"px, 0px, 0px)",b.slideTrack.css(c))},b.prototype.swipeStart=function(a){var c,b=this;c=a.originalEvent.touches,(1===b.touchObject.fingerCount||"drag"===a.data.kind)&&b.slideCount>b.options.slidesToShow?"touch"===a.data.kind?(b.touchObject.startX=b.touchObject.curX=c[0].pageX,b.touchObject.startY=b.touchObject.curY=c[0].pageY):(b.list.addClass("dragging"),b.touchObject.startX=b.touchObject.curX=a.clientX,b.touchObject.startY=b.touchObject.curY=a.clientY):b.touchObject={}},b.prototype.swipeMove=function(a){var c,e,b=this,d=null;e=a.originalEvent.touches,c=-1*b.currentSlide*b.slideWidth+b.slideOffset,e&&1===e.length||"drag"===a.data.kind?("touch"===a.data.kind?(b.touchObject.curX=e[0].pageX,b.touchObject.curY=e[0].pageY):(b.touchObject.curX=a.clientX,b.touchObject.curY=a.clientY),b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),"up"!==b.swipeDirection()&&"down"!==b.swipeDirection()&&b.options.touchMove===!0&&b.options.fade===!1&&(a.originalEvent.preventDefault(),b.touchObject.curX>b.touchObject.startX?(b.setLeft(c+b.touchObject.swipeLength),b.swipeLeft=d):(b.setLeft(c-b.touchObject.swipeLength),b.swipeLeft=d))):b.touchObject={}},b.prototype.swipeEnd=function(a){var b=this;if(0===b.touchObject.fingerCount&&0!==b.touchObject.curX||"drag"===a.data.kind){if(b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":b.slideHandler(b.currentSlide+b.options.slidesToScroll),b.touchObject={};break;case"right":b.slideHandler(b.currentSlide-b.options.slidesToScroll),b.touchObject={}}else b.slideHandler(b.currentSlide),b.touchObject={};"drag"===a.data.kind&&b.list.removeClass("dragging")}else b.touchObject={}},b.prototype.swipeCancel=function(){var a=this;a.list.removeClass("dragging"),a.touchObject.startX&&(a.slideHandler(a.currentSlide),a.touchObject={})},b.prototype.keyHandler=function(a){var b=this;37===a.keyCode?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.changeSlide({data:{message:"next"}})},b.prototype.swipeHandler=function(a){var b=this;switch("touch"===a.data.kind&&(b.touchObject.fingerCount=a.originalEvent.touches.length),b.touchObject.minSwipe=b.slideWidth/b.options.touchThreshold,a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a);break;case"cancel":b.swipeCancel()}},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?"left":360>=d&&d>=315?"left":d>=135&&225>=d?"right":d>45&&135>d?"down":"up"},b.prototype.refresh=function(){var b=this;b.destroy(),a.extend(b,b.initials),b.init()},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.slider).remove(),a(".slick-placeholder",b.slider).remove(),b.dots&&b.dots.remove(),b.prevArrow&&(b.prevArrow.remove(),b.nextArrow.remove()),b.slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style")},b.prototype.reinit=function(){var b=this;b.slides=a(b.options.slide+":not(.slick-cloned)",b.slideTrack).addClass("slick-slide"),b.slideCount=b.slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.setupPlaceholders(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.setSlideClasses(0),b.setPosition()},b.prototype.destroy=function(){var b=this;a(".slick-cloned",b.slider).remove(),a(".slick-placeholder",b.slider).remove(),b.dots&&b.dots.remove(),b.prevArrow&&(b.prevArrow.remove(),b.nextArrow.remove()),b.slides.unwrap().unwrap(),b.slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style"),b.slider.removeClass("slick-slider"),b.slider.removeClass("slick-initialized")},a.fn.slick=function(a){var c=this;return c.each(function(c,d){d.slick=new b(d,a)})},a.fn.slickAdd=function(a){var b=this;return b.each(function(b,c){c.slick.addSlide(a)})},a.fn.slickRemove=function(a){var b=this;return b.each(function(b,c){c.slick.removeSlide(a)})},a.fn.slickFilter=function(a){var b=this;return b.each(function(b,c){c.slick.filterSlides(a)})},a.fn.slickUnfilter=function(){var a=this;return a.each(function(a,b){b.slick.unfilterSlides()})},a.fn.slickGoTo=function(a){var b=this;return b.each(function(b,c){c.slick.slideHandler(a)})},a.fn.slickNext=function(){var a=this;return a.each(function(a,b){b.slick.changeSlide({data:{message:"next"}})})},a.fn.slickPrev=function(){var a=this;return a.each(function(a,b){b.slick.changeSlide({data:{message:"previous"}})})},a.fn.slickPause=function(){var a=this;return a.each(function(a,b){b.slick.autoPlayClear()})},a.fn.slickPlay=function(){var a=this;return a.each(function(a,b){b.slick.autoPlay()})},a.fn.unslick=function(){var a=this;return a.each(function(a,b){b.slick.destroy()})}}); | ||
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";var c,b=window.Slick||{};c=function(a,b){return function(){return a.apply(b,arguments)}},b=function(){function b(b,d){var f,g,e=this;if(e.defaults={accessibility:!0,autoplay:!1,autoplaySpeed:3e3,cssEase:"ease",dots:!1,draggable:!0,fade:!1,easing:"linear",arrows:!0,infinite:!0,onBeforeChange:null,onAfterChange:null,pauseOnHover:!0,responsive:null,slide:"div",slidesToShow:1,slidesToScroll:1,speed:300,swipe:!0,touchMove:!0,touchThreshold:5,vertical:!1},e.initials={animating:!1,autoPlayTimer:null,currentSlide:0,currentLeft:null,direction:1,dots:null,listWidth:null,listHeight:null,loadIndex:0,nextArrow:null,prevArrow:null,slideCount:null,slideWidth:null,slideTrack:null,slides:null,sliding:!1,slideOffset:0,swipeLeft:null,list:null,touchObject:{},transformsEnabled:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.breakpoints=[],e.breakpointSettings=[],e.slider=a(b),e.slidesCache=null,e.cssTransitions=!1,e.options=a.extend({},e.defaults,d),e.originalSettings=e.options,f=e.options.responsive||null,f&&f.length>-1){for(g in f)f.hasOwnProperty(g)&&(e.breakpoints.push(f[g].breakpoint),e.breakpointSettings[f[g].breakpoint]=f[g].settings);e.breakpoints.sort(function(a,b){return b-a})}e.autoPlay=c(e.autoPlay,e),e.autoPlayClear=c(e.autoPlayClear,e),e.changeSlide=c(e.changeSlide,e),e.setPosition=c(e.setPosition,e),e.swipeHandler=c(e.swipeHandler,e),e.dragHandler=c(e.dragHandler,e),e.keyHandler=c(e.keyHandler,e),e.autoPlayIterator=c(e.autoPlayIterator,e),e.init()}return b}(),b.prototype.init=function(){var b=this;a(b.slider).hasClass("slick-initialized")||(a(b.slider).addClass("slick-initialized"),b.buildOut(),b.getAnimType(),b.checkTransition(),b.startLoad(),b.loadSlider(),b.initializeEvents(),b.checkResponsive())},b.prototype.addSlide=function(b){var c=this;c.unload(),a(b).appendTo(c.slideTrack),c.slides=c.slideTrack.find(this.options.slide),c.slideTrack.find(this.options.slide).remove(),c.slideTrack.append(c.slides),c.reinit()},b.prototype.removeSlide=function(b){var c=this;return c.unload(),c.slideCount<1?!1:(a(c.slideTrack.find(this.options.slide).get(b)).remove(),c.slides=c.slideTrack.find(this.options.slide),c.slideTrack.find(this.options.slide).remove(),c.slideTrack.append(c.slides),c.reinit(),void 0)},b.prototype.filterSlides=function(a){var b=this;null!==a&&(b.unload(),b.slideTrack.find(this.options.slide).remove(),b.slidesCache.filter(a).appendTo(b.slideTrack),b.reinit())},b.prototype.unfilterSlides=function(){var a=this;null!==a.slidesCache&&(a.unload(),a.slideTrack.find(this.options.slide).remove(),a.slidesCache.appendTo(a.slideTrack),a.reinit())},b.prototype.checkTransition=function(){var a=this;void 0!==document.body.style.WebkitTransition?a.cssTransitions=!0:void 0!==document.body.style.MozTransition?a.cssTransitions=!0:void 0!==document.body.style.msTransition&&(a.cssTransitions=!0)},b.prototype.applyTransition=function(b){var d,e,c=this;d="all "+c.options.speed+"ms "+c.options.cssEase,e=c.options.vertical===!1?c.listWidth/2+" 50%":"",c.options.fade===!1?c.slideTrack.css({transition:d,transformOrigin:e}):a(c.slides.get(b)).css({transition:d})},b.prototype.disableTransition=function(b){var c=this;c.options.fade===!1?c.slideTrack.css({transition:"",transformOrigin:""}):a(c.slides.get(b)).css({transition:""})},b.prototype.getAnimType=function(){var a=this;void 0!==document.body.style.MozTransform?a.animType="MozTransform":void 0!==document.body.style.webkitTransform?a.animType="webkitTransform":void 0!==document.body.style.msTransform&&(a.animType="msTransform"),null!==a.animType&&(a.transformsEnabled=!0)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed)},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(0===a.currentSlide-1&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.checkResponsive=function(){var c,d,b=this;if(b.originalSettings.responsive&&b.originalSettings.responsive.length>-1){d=null;for(c in b.breakpoints)b.breakpoints.hasOwnProperty(c)&&a(window).width()<b.breakpoints[c]&&(d=b.breakpoints[c]);null!==d?null!==b.activeBreakpoint?d!==b.activeBreakpoint&&(b.activeBreakpoint=d,b.options=a.extend({},b.defaults,b.breakpointSettings[d]),b.refresh()):(b.activeBreakpoint=d,b.options=a.extend({},b.defaults,b.breakpointSettings[d]),b.refresh()):null!==b.activeBreakpoint&&(b.activeBreakpoint=null,b.options=a.extend({},b.defaults,b.originalSettings),b.refresh())}},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.prevArrow.hide(),a.nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.dots.hide(),a.slider.addClass("slick-loading")},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.prevArrow.show(),a.nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.loadSlider=function(){var b=this;b.setPosition(),b.slideTrack.css({opacity:1}),"complete"!==document.readyState?a(window).load(function(){b.slider.removeClass("slick-loading"),b.initUI()}):(b.slider.removeClass("slick-loading"),b.initUI())},b.prototype.setValues=function(){var a=this;a.listWidth=a.list.width(),a.listHeight=a.list.height(),a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.prevArrow=a('<a href="javascript:void(0)" tabIndex="-1">Previous</a>').appendTo(b.slider).addClass("slick-prev"),b.nextArrow=a('<a href="javascript:void(0)" tabIndex="-1">Next</a>').appendTo(b.slider).addClass("slick-next"),b.options.infinite!==!0&&b.prevArrow.addClass("slick-disabled"))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='<ul class="slick-dots">',c=1;c<=b.slideCount;c+=1)d+='<li><a href="javascript:void(0)" tabIndex="-1">'+c+"</a></li>";if(d+="</ul>",b.dots=a(d).appendTo(b.slider),b.options.slidesToScroll>1)for(b.dots.find("li").hide(),c=0;c<b.slideCount;)a(b.dots.find("li").get(c)).show(),c+=b.options.slidesToScroll;b.dots.find("li").first().addClass("slick-active")}},b.prototype.setupInfinite=function(){var c,d,b=this;if(b.options.infinite===!0&&b.options.fade===!1){for(d=null,c=b.slideCount;c>b.slideCount-b.options.slidesToShow;c-=1)d=c-1,a(b.slides[d]).clone().prependTo(b.slideTrack).addClass("slick-cloned");for(c=0;c<b.options.slidesToShow;c+=1)d=c,a(b.slides[d]).clone().appendTo(b.slideTrack).addClass("slick-cloned")}},b.prototype.setupPlaceholders=function(){var c,d,b=this;if((b.options.fade===!0||b.options.vertical===!0)&&(b.options.slidesToShow=1,b.options.slidesToScroll=1),0!==b.slideCount%b.options.slidesToScroll&&1!==b.options.slidesToShow){for(d=Math.abs(b.options.slidesToScroll-b.slideCount%b.options.slidesToScroll),c=0;d>c;c+=1)a("<div/>").appendTo(b.slideTrack).addClass("slick-slide slick-placeholder");b.slides=a(".slick-slide:not(.slick-cloned)",b.slider),b.slideCount=b.slides.length}},b.prototype.buildOut=function(){var b=this;b.slides=a(b.options.slide+":not(.slick-cloned)",b.slider).addClass("slick-slide"),b.slideCount=b.slides.length,b.slidesCache=b.slides,b.slider.addClass("slick-slider"),b.slideTrack=b.slides.wrapAll('<div class="slick-track"/>').parent(),b.list=b.slideTrack.wrap('<div class="slick-list"/>').parent(),b.slideTrack.css("opacity",0),b.options.accessibility===!0&&b.list.prop("tabIndex",0),b.setupPlaceholders(),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.setSlideClasses(0),b.options.draggable===!0&&b.list.addClass("draggable")},b.prototype.setDimensions=function(){var a=this;a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.list.find(".slick-slide").width(a.slideWidth),a.options.vertical===!1?a.slideTrack.width(Math.ceil(a.slideWidth*a.slider.find(".slick-slide").length)):a.slideTrack.height(Math.ceil(a.listHeight*a.slider.find(".slick-slide").length))},b.prototype.setPosition=function(){var b,c,a=this;a.setValues(),a.setDimensions(),a.options.infinite===!0&&(a.slideOffset=-1*a.slideWidth*a.options.slidesToShow),a.options.fade===!1?a.options.vertical===!1?(b=-1*a.currentSlide*a.slideWidth+a.slideOffset,a.setLeft(b)):(c=-1*a.currentSlide*a.listHeight-a.listHeight,a.setTop(c)):a.setFade()},b.prototype.setFade=function(){var c,b=this;b.slides.each(function(d,e){c=-1*b.slideWidth*d,a(e).css({position:"relative",left:c,top:0,zIndex:800,opacity:0})}),a(b.slides.get(b.currentSlide)).css({zIndex:900,opacity:1})},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li a",b.dots).on("click.slick",{message:"index"},b.changeSlide)},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.options.swipe===!0&&(b.list.on("touchstart.slick",{action:"start",kind:"touch"},b.swipeHandler),b.list.on("touchmove.slick",{action:"move",kind:"touch"},b.swipeHandler),b.list.on("touchend.slick",{action:"end",kind:"touch"},b.swipeHandler),b.list.on("touchcancel.slick",{action:"end",kind:"touch"},b.swipeHandler)),b.options.draggable===!0&&(b.list.on("mousedown.slick",{action:"start",kind:"drag"},b.swipeHandler),b.list.on("mousemove.slick",{action:"move",kind:"drag"},b.swipeHandler),b.list.on("mouseup.slick",{action:"end",kind:"drag"},b.swipeHandler),b.list.on("mouseleave.slick",{action:"cancel",kind:"drag"},b.swipeHandler)),b.options.pauseOnHover===!0&&b.options.autoplay===!0&&(b.list.on("mouseenter.slick",b.autoPlayClear),b.list.on("mouseleave.slick",b.autoPlay)),b.list.on("keydown.slick",b.keyHandler),a(window).on("orientationchange.slick",b.setPosition),a(window).on("resize.slick",function(){b.checkResponsive(),b.setPosition()}),a(window).on("load.slick",b.setPosition)},b.prototype.changeSlide=function(b){var c=this;switch(b.data.message){case"previous":c.slideHandler(c.currentSlide-c.options.slidesToScroll);break;case"next":c.slideHandler(c.currentSlide+c.options.slidesToScroll);break;case"index":c.slideHandler(a(b.target).parent().index());break;default:return!1}},b.prototype.updateDots=function(){var b=this;null!==b.dots&&(b.dots.find("li").removeClass("slick-active"),a(b.dots.find("li").get(b.currentSlide)).addClass("slick-active"))},b.prototype.updateArrows=function(){var a=this;a.options.arrows===!0&&a.options.infinite!==!0&&a.slideCount>a.options.slidesToShow&&(0===a.currentSlide?(a.prevArrow.addClass("slick-disabled"),a.nextArrow.removeClass("slick-disabled")):a.currentSlide>=a.slideCount/a.options.slidesToScroll*a.options.slidesToShow-a.options.slidesToScroll?(a.nextArrow.addClass("slick-disabled"),a.prevArrow.removeClass("slick-disabled")):(a.prevArrow.removeClass("slick-disabled"),a.nextArrow.removeClass("slick-disabled")))},b.prototype.fadeSlide=function(b,c){var d=this;d.cssTransitions===!1?(a(d.slides.get(b)).css({zIndex:1e3}),a(d.slides.get(b)).animate({opacity:1},d.options.speed,d.options.easing,c)):(d.applyTransition(b),a(d.slides.get(b)).css({opacity:1,zIndex:1e3}),c&&setTimeout(function(){d.disableTransition(b),c.call()},d.options.speed))},b.prototype.animateSlide=function(b,c){var d={},e=this;null!==e.options.onBeforeChange&&e.options.onBeforeChange.call(),e.transformsEnabled===!1?e.options.vertical===!1?e.slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px,0px)",e.slideTrack.css(d))},complete:function(){c&&c.call()}}):(e.applyTransition(),d[e.animType]=e.options.vertical===!1?"translate3d("+b+"px, 0px, 0px)":"translate3d(0px,"+b+"px, 0px)",e.slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.setSlideClasses=function(b){var c=this;c.slides.removeClass("slick-active"),a(c.slides.get(b)).addClass("slick-active")},b.prototype.postSlide=function(a){var b=this;b.animating=!1,b.currentSlide=a,b.setPosition(),b.swipeLeft=null,b.updateDots(),b.updateArrows(),b.options.autoplay===!0&&b.autoPlay(),null!==b.options.onAfterChange&&b.options.onAfterChange.call(),b.setSlideClasses(b.currentSlide)},b.prototype.slideHandler=function(a){var b,c,d=null,e=this;if(e.animating===!0)return!1;if(b=a,e.options.vertical===!1?(d=-1*b*e.slideWidth+e.slideOffset,c=-1*e.currentSlide*e.slideWidth+e.slideOffset):(d=-1*b*e.listHeight-e.listHeight,c=-1*e.currentSlide*e.listHeight-e.listHeight),e.options.autoplay===!0&&clearInterval(e.autoPlayTimer),e.currentLeft=null===e.swipeLeft?c:e.swipeLeft,0>b){if(e.options.fade===!0)return e.animating=!0,e.fadeSlide(e.slideCount-1,function(){e.postSlide(e.slideCount-1)}),!1;if(e.options.infinite!==!0)return e.animateSlide(c),!1;e.animating=!0,e.animateSlide(d,function(){e.postSlide(e.slideCount-e.options.slidesToScroll)})}else if(b>e.slideCount-1){if(e.options.fade===!0)return e.animating=!0,e.fadeSlide(0,function(){e.postSlide(0)}),!1;if(e.options.infinite!==!0)return e.animateSlide(c),!1;e.animating=!0,e.animateSlide(d,function(){e.postSlide(0)})}else{if(e.animating=!0,e.options.fade===!0)return e.animating=!0,e.fadeSlide(b,function(){e.postSlide(b)}),!1;e.animateSlide(d,function(){e.postSlide(b)})}},b.prototype.setTop=function(a){var b=this,c={};b.slideTrack.css({position:"absolute",display:"block"}),b.slideTrack.find(b.options.slide).css({height:"auto",display:"block","float":"none",border:"1px solid transparent"}),b.list.height(b.slides.first().outerHeight()),b.transformsEnabled===!1?b.slideTrack.css("top",a):b.cssTransitions===!1?(c[b.animType]="translate(0px, "+a+"px)",b.slideTrack.css(c)):(c[b.animType]="translate3d(0px, "+a+"px, 0px)",b.slideTrack.css(c))},b.prototype.setLeft=function(a){var b=this,c={};b.transformsEnabled===!1?b.slideTrack.css("left",a):b.cssTransitions===!1?(c[b.animType]="translate("+a+"px, 0px)",b.slideTrack.css(c)):(c[b.animType]="translate3d("+a+"px, 0px, 0px)",b.slideTrack.css(c))},b.prototype.swipeStart=function(a){var c,b=this;c=a.originalEvent.touches,(1===b.touchObject.fingerCount||"drag"===a.data.kind)&&b.slideCount>b.options.slidesToShow?"touch"===a.data.kind?(b.touchObject.startX=b.touchObject.curX=c[0].pageX,b.touchObject.startY=b.touchObject.curY=c[0].pageY):(b.list.addClass("dragging"),b.touchObject.startX=b.touchObject.curX=a.clientX,b.touchObject.startY=b.touchObject.curY=a.clientY):b.touchObject={}},b.prototype.swipeMove=function(a){var c,e,b=this,d=null;e=a.originalEvent.touches,c=b.options.vertical===!1?-1*b.currentSlide*b.slideWidth+b.slideOffset:-1*b.currentSlide*b.listHeight-b.listHeight,e&&1===e.length||"drag"===a.data.kind?("touch"===a.data.kind?(b.touchObject.curX=e[0].pageX,b.touchObject.curY=e[0].pageY):(b.touchObject.curX=a.clientX,b.touchObject.curY=a.clientY),b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),"up"!==b.swipeDirection()&&"down"!==b.swipeDirection()&&b.options.touchMove===!0&&(a.originalEvent.preventDefault(),b.touchObject.curX>b.touchObject.startX&&b.options.fade===!1?(b.options.vertical===!1?b.setLeft(c+b.touchObject.swipeLength):b.setTop(c+b.touchObject.swipeLength*(b.listHeight/b.listWidth)),b.swipeLeft=d):b.options.fade===!1&&(b.options.vertical===!1?b.setLeft(c-b.touchObject.swipeLength):b.setTop(c-b.touchObject.swipeLength*(b.listHeight/b.listWidth)),b.swipeLeft=d))):b.touchObject={}},b.prototype.swipeEnd=function(a){var b=this;if(0===b.touchObject.fingerCount&&0!==b.touchObject.curX||"drag"===a.data.kind){if(b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":b.slideHandler(b.currentSlide+b.options.slidesToScroll),b.touchObject={};break;case"right":b.slideHandler(b.currentSlide-b.options.slidesToScroll),b.touchObject={}}else b.options.fade===!1&&(b.slideHandler(b.currentSlide),b.touchObject={});"drag"===a.data.kind&&b.list.removeClass("dragging")}else b.touchObject={}},b.prototype.swipeCancel=function(){var a=this;a.list.removeClass("dragging"),a.touchObject.startX&&a.options.fade===!1&&(a.slideHandler(a.currentSlide),a.touchObject={})},b.prototype.keyHandler=function(a){var b=this;37===a.keyCode?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.changeSlide({data:{message:"next"}})},b.prototype.swipeHandler=function(a){var b=this;switch("touch"===a.data.kind&&(b.touchObject.fingerCount=a.originalEvent.touches.length),b.touchObject.minSwipe=b.slideWidth/b.options.touchThreshold,a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a);break;case"cancel":b.swipeCancel()}},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?"left":360>=d&&d>=315?"left":d>=135&&225>=d?"right":d>45&&135>d?"down":"up"},b.prototype.refresh=function(){var b=this;b.destroy(),a.extend(b,b.initials),b.init()},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.slider).remove(),a(".slick-placeholder",b.slider).remove(),b.dots&&b.dots.remove(),b.prevArrow&&(b.prevArrow.remove(),b.nextArrow.remove()),b.slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style")},b.prototype.reinit=function(){var b=this;b.slides=a(b.options.slide+":not(.slick-cloned)",b.slideTrack).addClass("slick-slide"),b.slideCount=b.slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.setupPlaceholders(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.setSlideClasses(0),b.setPosition()},b.prototype.destroy=function(){var b=this;a(".slick-cloned",b.slider).remove(),a(".slick-placeholder",b.slider).remove(),b.dots&&b.dots.remove(),b.prevArrow&&(b.prevArrow.remove(),b.nextArrow.remove()),b.slides.unwrap().unwrap(),b.slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style"),b.slider.removeClass("slick-slider"),b.slider.removeClass("slick-initialized")},a.fn.slick=function(a){var c=this;return c.each(function(c,d){d.slick=new b(d,a)})},a.fn.slickAdd=function(a){var b=this;return b.each(function(b,c){c.slick.addSlide(a)})},a.fn.slickRemove=function(a){var b=this;return b.each(function(b,c){c.slick.removeSlide(a)})},a.fn.slickFilter=function(a){var b=this;return b.each(function(b,c){c.slick.filterSlides(a)})},a.fn.slickUnfilter=function(){var a=this;return a.each(function(a,b){b.slick.unfilterSlides()})},a.fn.slickGoTo=function(a){var b=this;return b.each(function(b,c){c.slick.slideHandler(a)})},a.fn.slickNext=function(){var a=this;return a.each(function(a,b){b.slick.changeSlide({data:{message:"next"}})})},a.fn.slickPrev=function(){var a=this;return a.each(function(a,b){b.slick.changeSlide({data:{message:"previous"}})})},a.fn.slickPause=function(){var a=this;return a.each(function(a,b){b.slick.autoPlayClear()})},a.fn.slickPlay=function(){var a=this;return a.each(function(a,b){b.slick.autoPlay()})},a.fn.unslick=function(){var a=this;return a.each(function(a,b){b.slick.destroy()})}}); |
{ | ||
"name": "slick-carousel", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "the last carousel you'll ever need", | ||
@@ -5,0 +5,0 @@ "main": "js/slick.js", |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"author": { | ||
@@ -15,0 +15,0 @@ "name": "Ken Wheeler", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1158515
1604
83