/* _ _ _ _ ___| (_) ___| | __ (_)___ / __| | |/ __| |/ / | / __| \__ \ | | (__| < _ | \__ \ |___/_|_|\___|_|\_(_)/ |___/ |__/ version: 1.5.9 author: ken wheeler website: http://kenwheeler.github.io docs: http://kenwheeler.github.io/slick repo: http://github.com/kenwheeler/slick issues: http://github.com/kenwheeler/slick/issues */ /* global window, document, define, jquery, setinterval, clearinterval */ (function(factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof exports !== 'undefined') { module.exports = factory(require('jquery')); } else { factory(jquery); } }(function($) { 'use strict'; var slick = window.slick || {}; slick = (function() { var instanceuid = 0; function slick(element, settings) { var _ = this, datasettings; _.defaults = { accessibility: true, adaptiveheight: false, appendarrows: $(element), appenddots: $(element), arrows: true, asnavfor: null, prevarrow: '', nextarrow: '', autoplay: false, autoplayspeed: 3000, centermode: false, centerpadding: '50px', cssease: 'ease', custompaging: function(slider, i) { return $('').text(i + 1); }, dots: false, dotsclass: 'slick-dots', draggable: true, easing: 'linear', edgefriction: 0.35, fade: false, focusonselect: false, infinite: true, initialslide: 0, lazyload: 'ondemand', mobilefirst: false, pauseonhover: true, pauseonfocus: true, pauseondotshover: false, respondto: 'window', responsive: null, rows: 1, rtl: false, slide: '', slidesperrow: 1, slidestoshow: 1, slidestoscroll: 1, speed: 500, swipe: true, swipetoslide: false, touchmove: true, touchthreshold: 5, usecss: true, usetransform: true, variablewidth: false, vertical: false, verticalswiping: false, waitforanimate: true, zindex: 1000 }; _.initials = { animating: false, dragging: false, autoplaytimer: null, currentdirection: 0, currentleft: null, currentslide: 0, direction: 1, $dots: null, listwidth: null, listheight: null, loadindex: 0, $nextarrow: null, $prevarrow: null, slidecount: null, slidewidth: null, $slidetrack: null, $slides: null, sliding: false, slideoffset: 0, swipeleft: null, $list: null, touchobject: {}, transformsenabled: false, unslicked: false }; $.extend(_, _.initials); _.activebreakpoint = null; _.animtype = null; _.animprop = null; _.breakpoints = []; _.breakpointsettings = []; _.csstransitions = false; _.focussed = false; _.interrupted = false; _.hidden = 'hidden'; _.paused = true; _.positionprop = null; _.respondto = null; _.rowcount = 1; _.shouldclick = true; _.$slider = $(element); _.$slidescache = null; _.transformtype = null; _.transitiontype = null; _.visibilitychange = 'visibilitychange'; _.windowwidth = 0; _.windowtimer = null; datasettings = $(element).data('slick') || {}; _.options = $.extend({}, _.defaults, settings, datasettings); _.currentslide = _.options.initialslide; _.originalsettings = _.options; if (typeof document.mozhidden !== 'undefined') { _.hidden = 'mozhidden'; _.visibilitychange = 'mozvisibilitychange'; } else if (typeof document.webkithidden !== 'undefined') { _.hidden = 'webkithidden'; _.visibilitychange = 'webkitvisibilitychange'; } _.autoplay = $.proxy(_.autoplay, _); _.autoplayclear = $.proxy(_.autoplayclear, _); _.autoplayiterator = $.proxy(_.autoplayiterator, _); _.changeslide = $.proxy(_.changeslide, _); _.clickhandler = $.proxy(_.clickhandler, _); _.selecthandler = $.proxy(_.selecthandler, _); _.setposition = $.proxy(_.setposition, _); _.swipehandler = $.proxy(_.swipehandler, _); _.draghandler = $.proxy(_.draghandler, _); _.keyhandler = $.proxy(_.keyhandler, _); _.instanceuid = instanceuid++; // a simple way to check for html strings // strict html recognition (must start with <) // extracted from jquery v1.11 source _.htmlexpr = /^(?:\s*(<[\w\w]+>)[^>]*)$/; _.registerbreakpoints(); _.init(true); } return slick; }()); slick.prototype.activateada = function() { var _ = this; _.$slidetrack.find('.slick-active').attr({ 'aria-hidden': 'false' }).find('a, input, button, select').attr({ 'tabindex': '0' }); }; slick.prototype.addslide = slick.prototype.slickadd = function(markup, index, addbefore) { var _ = this; if (typeof(index) === 'boolean') { addbefore = index; index = null; } else if (index < 0 || (index >= _.slidecount)) { return false; } _.unload(); if (typeof(index) === 'number') { if (index === 0 && _.$slides.length === 0) { $(markup).appendto(_.$slidetrack); } else if (addbefore) { $(markup).insertbefore(_.$slides.eq(index)); } else { $(markup).insertafter(_.$slides.eq(index)); } } else { if (addbefore === true) { $(markup).prependto(_.$slidetrack); } else { $(markup).appendto(_.$slidetrack); } } _.$slides = _.$slidetrack.children(this.options.slide); _.$slidetrack.children(this.options.slide).detach(); _.$slidetrack.append(_.$slides); _.$slides.each(function(index, element) { $(element).attr('data-slick-index', index); }); _.$slidescache = _.$slides; _.reinit(); }; slick.prototype.animateheight = function() { var _ = this; if (_.options.slidestoshow === 1 && _.options.adaptiveheight === true && _.options.vertical === false) { var targetheight = _.$slides.eq(_.currentslide).outerheight(true); _.$list.animate({ height: targetheight }, _.options.speed); } }; slick.prototype.animateslide = function(targetleft, callback) { var animprops = {}, _ = this; _.animateheight(); if (_.options.rtl === true && _.options.vertical === false) { targetleft = -targetleft; } 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); } } else { if (_.csstransitions === false) { if (_.options.rtl === true) { _.currentleft = -(_.currentleft); } $({ animstart: _.currentleft }).animate({ animstart: targetleft }, { duration: _.options.speed, easing: _.options.easing, step: function(now) { now = math.ceil(now); if (_.options.vertical === false) { animprops[_.animtype] = 'translate(' + now + 'px, 0px)'; _.$slidetrack.css(animprops); } else { animprops[_.animtype] = 'translate(0px,' + now + 'px)'; _.$slidetrack.css(animprops); } }, complete: function() { if (callback) { callback.call(); } } }); } else { _.applytransition(); targetleft = math.ceil(targetleft); if (_.options.vertical === false) { animprops[_.animtype] = 'translate3d(' + targetleft + 'px, 0px, 0px)'; } else { animprops[_.animtype] = 'translate3d(0px,' + targetleft + 'px, 0px)'; } _.$slidetrack.css(animprops); if (callback) { settimeout(function() { _.disabletransition(); callback.call(); }, _.options.speed); } } } }; slick.prototype.getnavtarget = function() { var _ = this, asnavfor = _.options.asnavfor; if ( asnavfor && asnavfor !== null ) { asnavfor = $(asnavfor).not(_.$slider); } return asnavfor; }; slick.prototype.asnavfor = function(index) { var _ = this, asnavfor = _.getnavtarget(); if ( asnavfor !== null && typeof asnavfor === 'object' ) { asnavfor.each(function() { var target = $(this).slick('getslick'); if(!target.unslicked) { target.slidehandler(index, true); } }); } }; slick.prototype.applytransition = function(slide) { var _ = this, transition = {}; if (_.options.fade === false) { transition[_.transitiontype] = _.transformtype + ' ' + _.options.speed + 'ms ' + _.options.cssease; } else { transition[_.transitiontype] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssease; } if (_.options.fade === false) { _.$slidetrack.css(transition); } else { _.$slides.eq(slide).css(transition); } }; slick.prototype.autoplay = function() { var _ = this; _.autoplayclear(); if ( _.slidecount > _.options.slidestoshow ) { _.autoplaytimer = setinterval( _.autoplayiterator, _.options.autoplayspeed ); } }; slick.prototype.autoplayclear = function() { var _ = this; if (_.autoplaytimer) { clearinterval(_.autoplaytimer); } }; slick.prototype.autoplayiterator = function() { var _ = this, slideto = _.currentslide + _.options.slidestoscroll; if ( !_.paused && !_.interrupted && !_.focussed ) { if ( _.options.infinite === false ) { if ( _.direction === 1 && ( _.currentslide + 1 ) === ( _.slidecount - 1 )) { _.direction = 0; } else if ( _.direction === 0 ) { slideto = _.currentslide - _.options.slidestoscroll; if ( _.currentslide - 1 === 0 ) { _.direction = 1; } } } _.slidehandler( slideto ); } }; slick.prototype.buildarrows = function() { var _ = this; if (_.options.arrows === true ) { _.$prevarrow = $(_.options.prevarrow).addclass('slick-arrow'); _.$nextarrow = $(_.options.nextarrow).addclass('slick-arrow'); if( _.slidecount > _.options.slidestoshow ) { _.$prevarrow.removeclass('slick-hidden').removeattr('aria-hidden tabindex'); _.$nextarrow.removeclass('slick-hidden').removeattr('aria-hidden tabindex'); if (_.htmlexpr.test(_.options.prevarrow)) { _.$prevarrow.prependto(_.options.appendarrows); } if (_.htmlexpr.test(_.options.nextarrow)) { _.$nextarrow.appendto(_.options.appendarrows); } if (_.options.infinite !== true) { _.$prevarrow .addclass('slick-disabled') .attr('aria-disabled', 'true'); } } else { _.$prevarrow.add( _.$nextarrow ) .addclass('slick-hidden') .attr({ 'aria-disabled': 'true', 'tabindex': '-1' }); } } }; slick.prototype.builddots = function() { var _ = this, i, dot; if (_.options.dots === true && _.slidecount > _.options.slidestoshow) { _.$slider.addclass('slick-dotted'); dot = $('