/*! modernizr 3.1.0 (custom build) | mit * * http://modernizr.com/download/?-backgroundsize-bgsizecover-borderradius-boxshadow-cssanimations-csstransforms-csstransforms3d-csstransitions-touchevents !*/ !function(e,n,t){function s(e){var n=c.classname,t=modernizr._config.classprefix||"";if(s&&(n=n.baseval),modernizr._config.enablejsclass){var s=new regexp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(s,"$1"+t+"js$2")}modernizr._config.enableclasses&&(n+=" "+t+e.join(" "+t),s?c.classname.baseval=n:c.classname=n)}function o(e,n){return typeof e===n}function r(){var e,n,t,s,r,i,a;for(var f in x){if(e=[],n=x[f],n.name&&(e.push(n.name.tolowercase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;tp;p++)if(v=e[p],h=j.style[v],u(v,"-")&&(v=l(v)),j.style[v]!==t){if(r||o(s,"undefined"))return a(),"pfx"==n?v:!0;try{j.style[v]=s}catch(y){}if(j.style[v]!=h)return a(),"pfx"==n?v:!0}return a(),!1}function h(e,n,t,s,r){var i=e.charat(0).touppercase()+e.slice(1),a=(e+" "+p.join(i+" ")+i).split(" ");return o(n,"string")||o(n,"undefined")?v(a,n,s,r):(a=(e+" "+e.join(i+" ")+i).split(" "),p(a,n,t))}function g(e,n,s){return h(e,t,t,n,s)}var y=[],x=[],b={_version:"3.1.0",_config:{classprefix:"",enableclasses:!0,enablejsclass:!0,useprefixes:!0},_q:[],on:function(e,n){var t=this;settimeout(function(){n(t[e])},0)},addtest:function(e,n,t){x.push({name:e,fn:n,options:t})},addasynctest:function(e){x.push({name:null,fn:e})}},modernizr=function(){};modernizr.prototype=b,modernizr=new modernizr;var c=n.documentelement,s="svg"===c.nodename.tolowercase(),w=b._config.useprefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];b._prefixes=w;var _="css"in e&&"supports"in e.css,t="supportscss"in e;modernizr.addtest("supports",_||t);var z=b.teststyles=f;modernizr.addtest("touchevents",function(){var t;if("ontouchstart"in e||e.documenttouch&&n instanceof documenttouch)t=!0;else{var s=["@media (",w.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");z(s,function(e){t=9===e.offsettop})}return t});var k="moz o ms webkit",p=b._config.useprefixes?k.split(" "):[];b._cssomprefixes=p;var e=b._config.useprefixes?k.tolowercase().split(" "):[];b._domprefixes=e;var n={elem:i("modernizr")};modernizr._q.push(function(){delete n.elem});var j={style:n.elem.style};modernizr._q.unshift(function(){delete j.style}),b.testallprops=h,b.testallprops=g,modernizr.addtest("cssanimations",g("animationname","a",!0)),modernizr.addtest("backgroundsize",g("backgroundsize","100%",!0)),modernizr.addtest("csstransitions",g("transition","all",!0)),modernizr.addtest("csstransforms3d",function(){var e=!!g("perspective","1px",!0),n=modernizr._config.useprefixes;if(e&&(!n||"webkitperspective"in c.style)){var t;modernizr.supports?t="@supports (perspective: 1px)":(t="@media (transform-3d)",n&&(t+=",(-webkit-transform-3d)")),t+="{#modernizr{left:9px;position:absolute;height:5px;margin:0;padding:0;border:0}}",z(t,function(n){e=9===n.offsetleft&&5===n.offsetheight})}return e}),modernizr.addtest("bgsizecover",g("backgroundsize","cover")),modernizr.addtest("borderradius",g("borderradius","0px",!0)),modernizr.addtest("boxshadow",g("boxshadow","1px 1px",!0)),modernizr.addtest("csstransforms",function(){return-1===navigator.useragent.indexof("android 2.")&&g("transform","scale(1)",!0)}),r(),s(y),delete b.addtest,delete b.addasynctest;for(var a=0;a0?a.charat(0).touppercase()+a.slice(1):a)}}(),k=j("transform"),l=a("
",{style:"background:#fff"}).css("background-position-x")!==d,m=l?function(a,b,c){a.css({"background-position-x":b,"background-position-y":c})}:function(a,b,c){a.css("background-position",b+" "+c)},n=l?function(a){return[a.css("background-position-x"),a.css("background-position-y")]}:function(a){return a.css("background-position").split(" ")},o=b.requestanimationframe||b.webkitrequestanimationframe||b.mozrequestanimationframe||b.orequestanimationframe||b.msrequestanimationframe||function(a){settimeout(a,1e3/60)};e.prototype={init:function(){this.options.name=f+"_"+math.floor(1e9*math.random()),this._defineelements(),this._definegetters(),this._definesetters(),this._handlewindowloadandresize(),this._detectviewport(),this.refresh({firstload:!0}),"scroll"===this.options.scrollproperty?this._handlescrollevent():this._startanimationloop()},_defineelements:function(){this.element===c.body&&(this.element=b),this.$scrollelement=a(this.element),this.$element=this.element===b?a("body"):this.$scrollelement,this.$viewportelement=this.options.viewportelement!==d?a(this.options.viewportelement):this.$scrollelement[0]===b||"scroll"===this.options.scrollproperty?this.$scrollelement:this.$scrollelement.parent()},_definegetters:function(){var a=this,b=h[a.options.scrollproperty];this._getscrollleft=function(){return b.getleft(a.$scrollelement)},this._getscrolltop=function(){return b.gettop(a.$scrollelement)}},_definesetters:function(){var b=this,c=h[b.options.scrollproperty],d=i[b.options.positionproperty],e=c.setleft,f=c.settop;this._setscrollleft="function"==typeof e?function(a){e(b.$scrollelement,a)}:a.noop,this._setscrolltop="function"==typeof f?function(a){f(b.$scrollelement,a)}:a.noop,this._setposition=d.setposition||function(a,c,e,f,g){b.options.horizontalscrolling&&d.setleft(a,c,e),b.options.verticalscrolling&&d.settop(a,f,g)}},_handlewindowloadandresize:function(){var c=this,d=a(b);c.options.responsive&&d.bind("load."+this.name,function(){c.refresh()}),d.bind("resize."+this.name,function(){c._detectviewport(),c.options.responsive&&c.refresh()})},refresh:function(c){var d=this,e=d._getscrollleft(),f=d._getscrolltop();c&&c.firstload||this._reset(),this._setscrollleft(0),this._setscrolltop(0),this._setoffsets(),this._findparticles(),this._findbackgrounds(),c&&c.firstload&&/webkit/.test(navigator.useragent)&&a(b).load(function(){var a=d._getscrollleft(),b=d._getscrolltop();d._setscrollleft(a+1),d._setscrolltop(b+1),d._setscrollleft(a),d._setscrolltop(b)}),this._setscrollleft(e),this._setscrolltop(f)},_detectviewport:function(){var a=this.$viewportelement.offset(),b=null!==a&&a!==d;this.viewportwidth=this.$viewportelement.width(),this.viewportheight=this.$viewportelement.height(),this.viewportoffsettop=b?a.top:0,this.viewportoffsetleft=b?a.left:0},_findparticles:function(){{var b=this;this._getscrollleft(),this._getscrolltop()}if(this.particles!==d)for(var c=this.particles.length-1;c>=0;c--)this.particles[c].$element.data("stellar-elementisactive",d);this.particles=[],this.options.parallaxelements&&this.$element.find("[data-stellar-ratio]").each(function(){var c,e,f,g,h,i,j,k,l,m=a(this),n=0,o=0,p=0,q=0;if(m.data("stellar-elementisactive")){if(m.data("stellar-elementisactive")!==this)return}else m.data("stellar-elementisactive",this);b.options.showelement(m),m.data("stellar-startingleft")?(m.css("left",m.data("stellar-startingleft")),m.css("top",m.data("stellar-startingtop"))):(m.data("stellar-startingleft",m.css("left")),m.data("stellar-startingtop",m.css("top"))),f=m.position().left,g=m.position().top,h="auto"===m.css("margin-left")?0:parseint(m.css("margin-left"),10),i="auto"===m.css("margin-top")?0:parseint(m.css("margin-top"),10),k=m.offset().left-h,l=m.offset().top-i,m.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(n=p,o=q,j=b,!1):(p+=b.position().left,void(q+=b.position().top))}),c=m.data("stellar-horizontal-offset")!==d?m.data("stellar-horizontal-offset"):j!==d&&j.data("stellar-horizontal-offset")!==d?j.data("stellar-horizontal-offset"):b.horizontaloffset,e=m.data("stellar-vertical-offset")!==d?m.data("stellar-vertical-offset"):j!==d&&j.data("stellar-vertical-offset")!==d?j.data("stellar-vertical-offset"):b.verticaloffset,b.particles.push({$element:m,$offsetparent:j,isfixed:"fixed"===m.css("position"),horizontaloffset:c,verticaloffset:e,startingpositionleft:f,startingpositiontop:g,startingoffsetleft:k,startingoffsettop:l,parentoffsetleft:n,parentoffsettop:o,stellarratio:m.data("stellar-ratio")!==d?m.data("stellar-ratio"):1,width:m.outerwidth(!0),height:m.outerheight(!0),ishidden:!1})})},_findbackgrounds:function(){var b,c=this,e=this._getscrollleft(),f=this._getscrolltop();this.backgrounds=[],this.options.parallaxbackgrounds&&(b=this.$element.find("[data-stellar-background-ratio]"),this.$element.data("stellar-background-ratio")&&(b=b.add(this.$element)),b.each(function(){var b,g,h,i,j,k,l,o=a(this),p=n(o),q=0,r=0,s=0,t=0;if(o.data("stellar-backgroundisactive")){if(o.data("stellar-backgroundisactive")!==this)return}else o.data("stellar-backgroundisactive",this);o.data("stellar-backgroundstartingleft")?m(o,o.data("stellar-backgroundstartingleft"),o.data("stellar-backgroundstartingtop")):(o.data("stellar-backgroundstartingleft",p[0]),o.data("stellar-backgroundstartingtop",p[1])),h="auto"===o.css("margin-left")?0:parseint(o.css("margin-left"),10),i="auto"===o.css("margin-top")?0:parseint(o.css("margin-top"),10),j=o.offset().left-h-e,k=o.offset().top-i-f,o.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(q=s,r=t,l=b,!1):(s+=b.position().left,void(t+=b.position().top))}),b=o.data("stellar-horizontal-offset")!==d?o.data("stellar-horizontal-offset"):l!==d&&l.data("stellar-horizontal-offset")!==d?l.data("stellar-horizontal-offset"):c.horizontaloffset,g=o.data("stellar-vertical-offset")!==d?o.data("stellar-vertical-offset"):l!==d&&l.data("stellar-vertical-offset")!==d?l.data("stellar-vertical-offset"):c.verticaloffset,c.backgrounds.push({$element:o,$offsetparent:l,isfixed:"fixed"===o.css("background-attachment"),horizontaloffset:b,verticaloffset:g,startingvalueleft:p[0],startingvaluetop:p[1],startingbackgroundpositionleft:isnan(parseint(p[0],10))?0:parseint(p[0],10),startingbackgroundpositiontop:isnan(parseint(p[1],10))?0:parseint(p[1],10),startingpositionleft:o.position().left,startingpositiontop:o.position().top,startingoffsetleft:j,startingoffsettop:k,parentoffsetleft:q,parentoffsettop:r,stellarratio:o.data("stellar-background-ratio")===d?1:o.data("stellar-background-ratio")})}))},_reset:function(){var a,b,c,d,e;for(e=this.particles.length-1;e>=0;e--)a=this.particles[e],b=a.$element.data("stellar-startingleft"),c=a.$element.data("stellar-startingtop"),this._setposition(a.$element,b,b,c,c),this.options.showelement(a.$element),a.$element.data("stellar-startingleft",null).data("stellar-elementisactive",null).data("stellar-backgroundisactive",null);for(e=this.backgrounds.length-1;e>=0;e--)d=this.backgrounds[e],d.$element.data("stellar-backgroundstartingleft",null).data("stellar-backgroundstartingtop",null),m(d.$element,d.startingvalueleft,d.startingvaluetop)},destroy:function(){this._reset(),this.$scrollelement.unbind("resize."+this.name).unbind("scroll."+this.name),this._animationloop=a.noop,a(b).unbind("load."+this.name).unbind("resize."+this.name)},_setoffsets:function(){var c=this,d=a(b);d.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name),"function"==typeof this.options.horizontaloffset?(this.horizontaloffset=this.options.horizontaloffset(),d.bind("resize.horizontal-"+this.name,function(){c.horizontaloffset=c.options.horizontaloffset()})):this.horizontaloffset=this.options.horizontaloffset,"function"==typeof this.options.verticaloffset?(this.verticaloffset=this.options.verticaloffset(),d.bind("resize.vertical-"+this.name,function(){c.verticaloffset=c.options.verticaloffset()})):this.verticaloffset=this.options.verticaloffset},_repositionelements:function(){var a,b,c,d,e,f,g,h,i,j,k=this._getscrollleft(),l=this._getscrolltop(),n=!0,o=!0;if(this.currentscrollleft!==k||this.currentscrolltop!==l||this.currentwidth!==this.viewportwidth||this.currentheight!==this.viewportheight){for(this.currentscrollleft=k,this.currentscrolltop=l,this.currentwidth=this.viewportwidth,this.currentheight=this.viewportheight,j=this.particles.length-1;j>=0;j--)a=this.particles[j],b=a.isfixed?1:0,this.options.horizontalscrolling?(f=(k+a.horizontaloffset+this.viewportoffsetleft+a.startingpositionleft-a.startingoffsetleft+a.parentoffsetleft)*-(a.stellarratio+b-1)+a.startingpositionleft,h=f-a.startingpositionleft+a.startingoffsetleft):(f=a.startingpositionleft,h=a.startingoffsetleft),this.options.verticalscrolling?(g=(l+a.verticaloffset+this.viewportoffsettop+a.startingpositiontop-a.startingoffsettop+a.parentoffsettop)*-(a.stellarratio+b-1)+a.startingpositiontop,i=g-a.startingpositiontop+a.startingoffsettop):(g=a.startingpositiontop,i=a.startingoffsettop),this.options.hidedistantelements&&(o=!this.options.horizontalscrolling||h+a.width>(a.isfixed?0:k)&&h<(a.isfixed?0:k)+this.viewportwidth+this.viewportoffsetleft,n=!this.options.verticalscrolling||i+a.height>(a.isfixed?0:l)&&i<(a.isfixed?0:l)+this.viewportheight+this.viewportoffsettop),o&&n?(a.ishidden&&(this.options.showelement(a.$element),a.ishidden=!1),this._setposition(a.$element,f,a.startingpositionleft,g,a.startingpositiontop)):a.ishidden||(this.options.hideelement(a.$element),a.ishidden=!0);for(j=this.backgrounds.length-1;j>=0;j--)c=this.backgrounds[j],b=c.isfixed?0:1,d=this.options.horizontalscrolling?(k+c.horizontaloffset-this.viewportoffsetleft-c.startingoffsetleft+c.parentoffsetleft-c.startingbackgroundpositionleft)*(b-c.stellarratio)+"px":c.startingvalueleft,e=this.options.verticalscrolling?(l+c.verticaloffset-this.viewportoffsettop-c.startingoffsettop+c.parentoffsettop-c.startingbackgroundpositiontop)*(b-c.stellarratio)+"px":c.startingvaluetop,m(c.$element,d,e)}},_handlescrollevent:function(){var a=this,b=!1,c=function(){a._repositionelements(),b=!1},d=function(){b||(o(c),b=!0)};this.$scrollelement.bind("scroll."+this.name,d),d()},_startanimationloop:function(){var a=this;this._animationloop=function(){o(a._animationloop),a._repositionelements()},this._animationloop()}},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a.data(this,"plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,array.prototype.slice.call(c,1)),"destroy"===b&&a.data(this,"plugin_"+f,null)}):void 0},a[f]=function(){var c=a(b);return c.stellar.apply(c,array.prototype.slice.call(arguments,0))},a[f].scrollproperty=h,a[f].positionproperty=i,b.stellar=e}(jquery,this,document); /*********************************************************************************************/ // 渐入效果 /*********************************************************************************************/ (function(jquery){ $.fn.scrollclass = function(config){ var defaults = {}; var config = jquery.extend(defaults, config); var target = this; function addaction(){ var length = target.length; for(var i=0; i window_bottom_position){ target.eq(i).removeclass('action'); } if(wp < jquery(window).scrolltop()){ target.eq(i).removeclass('action'); } } } addaction(); jquery(window).on('scroll', function(){ addaction(); }); return target; }; } )(jquery); /* _ _ _ _ ___| (_) ___| | __ (_)___ / __| | |/ __| |/ / | / __| \__ \ | | (__| < _ | \__ \ |___/_|_|\___|_|\_(_)/ |___/ |__/ version: 1.5.7 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 '' + (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, 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, 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; _.hidden = 'hidden'; _.paused = false; _.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, datasettings, settings); _.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, _); _.changeslide = $.proxy(_.changeslide, _); _.clickhandler = $.proxy(_.clickhandler, _); _.selecthandler = $.proxy(_.selecthandler, _); _.setposition = $.proxy(_.setposition, _); _.swipehandler = $.proxy(_.swipehandler, _); _.draghandler = $.proxy(_.draghandler, _); _.keyhandler = $.proxy(_.keyhandler, _); _.autoplayiterator = $.proxy(_.autoplayiterator, _); _.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); _.checkresponsive(true); } return slick; }()); 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.asnavfor = function(index) { var _ = this, asnavfor = _.options.asnavfor; if ( asnavfor && asnavfor !== null ) { asnavfor = $(asnavfor).not(_.$slider); } 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; if (_.autoplaytimer) { clearinterval(_.autoplaytimer); } if (_.slidecount > _.options.slidestoshow && _.paused !== true) { _.autoplaytimer = setinterval(_.autoplayiterator, _.options.autoplayspeed); } }; slick.prototype.autoplayclear = function() { var _ = this; if (_.autoplaytimer) { clearinterval(_.autoplaytimer); } }; slick.prototype.autoplayiterator = function() { var _ = this; if (_.options.infinite === false) { if (_.direction === 1) { if ((_.currentslide + 1) === _.slidecount - 1) { _.direction = 0; } _.slidehandler(_.currentslide + _.options.slidestoscroll); } else { if ((_.currentslide - 1 === 0)) { _.direction = 1; } _.slidehandler(_.currentslide - _.options.slidestoscroll); } } else { _.slidehandler(_.currentslide + _.options.slidestoscroll); } }; 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, dotstring; if (_.options.dots === true && _.slidecount > _.options.slidestoshow) { dotstring = '
    '; for (i = 0; i <= _.getdotcount(); i += 1) { dotstring += '
  • ' + _.options.custompaging.call(this, _, i) + '
  • '; } dotstring += '
'; _.$dots = $(dotstring).appendto( _.options.appenddots); _.$dots.find('li').first().addclass('slick-active').attr('aria-hidden', 'false'); } }; slick.prototype.buildout = function() { var _ = this; _.$slides = _.$slider .children( _.options.slide + ':not(.slick-cloned)') .addclass('slick-slide'); _.slidecount = _.$slides.length; _.$slides.each(function(index, element) { $(element) .attr('data-slick-index', index) .data('originalstyling', $(element).attr('style') || ''); }); _.$slidescache = _.$slides; _.$slider.addclass('slick-slider'); _.$slidetrack = (_.slidecount === 0) ? $('
').appendto(_.$slider) : _.$slides.wrapall('
').parent(); _.$list = _.$slidetrack.wrap( '
').parent(); _.$slidetrack.css('opacity', 0); if (_.options.centermode === true || _.options.swipetoslide === true) { _.options.slidestoscroll = 1; } $('img[data-lazy]', _.$slider).not('[src]').addclass('slick-loading'); _.setupinfinite(); _.buildarrows(); _.builddots(); _.updatedots(); _.setslideclasses(typeof _.currentslide === 'number' ? _.currentslide : 0); if (_.options.draggable === true) { _.$list.addclass('draggable'); } }; slick.prototype.buildrows = function() { var _ = this, a, b, c, newslides, numofslides, originalslides,slidespersection; newslides = document.createdocumentfragment(); originalslides = _.$slider.children(); if(_.options.rows > 1) { slidespersection = _.options.slidesperrow * _.options.rows; numofslides = math.ceil( originalslides.length / slidespersection ); for(a = 0; a < numofslides; a++){ var slide = document.createelement('div'); for(b = 0; b < _.options.rows; b++) { var row = document.createelement('div'); for(c = 0; c < _.options.slidesperrow; c++) { var target = (a * slidespersection + ((b * _.options.slidesperrow) + c)); if (originalslides.get(target)) { row.appendchild(originalslides.get(target)); } } slide.appendchild(row); } newslides.appendchild(slide); } _.$slider.html(newslides); _.$slider.children().children().children() .css({ 'width':(100 / _.options.slidesperrow) + '%', 'display': 'inline-block' }); } }; slick.prototype.checkresponsive = function(initial, forceupdate) { var _ = this, breakpoint, targetbreakpoint, respondtowidth, triggerbreakpoint = false; var sliderwidth = _.$slider.width(); var windowwidth = window.innerwidth || $(window).width(); if (_.respondto === 'window') { respondtowidth = windowwidth; } else if (_.respondto === 'slider') { respondtowidth = sliderwidth; } else if (_.respondto === 'min') { respondtowidth = math.min(windowwidth, sliderwidth); } if ( _.options.responsive && _.options.responsive.length && _.options.responsive !== null) { targetbreakpoint = null; for (breakpoint in _.breakpoints) { if (_.breakpoints.hasownproperty(breakpoint)) { if (_.originalsettings.mobilefirst === false) { if (respondtowidth < _.breakpoints[breakpoint]) { targetbreakpoint = _.breakpoints[breakpoint]; } } else { if (respondtowidth > _.breakpoints[breakpoint]) { targetbreakpoint = _.breakpoints[breakpoint]; } } } } if (targetbreakpoint !== null) { if (_.activebreakpoint !== null) { if (targetbreakpoint !== _.activebreakpoint || forceupdate) { _.activebreakpoint = targetbreakpoint; if (_.breakpointsettings[targetbreakpoint] === 'unslick') { _.unslick(targetbreakpoint); } else { _.options = $.extend({}, _.originalsettings, _.breakpointsettings[ targetbreakpoint]); if (initial === true) { _.currentslide = _.options.initialslide; } _.refresh(initial); } triggerbreakpoint = targetbreakpoint; } } else { _.activebreakpoint = targetbreakpoint; if (_.breakpointsettings[targetbreakpoint] === 'unslick') { _.unslick(targetbreakpoint); } else { _.options = $.extend({}, _.originalsettings, _.breakpointsettings[ targetbreakpoint]); if (initial === true) { _.currentslide = _.options.initialslide; } _.refresh(initial); } triggerbreakpoint = targetbreakpoint; } } else { if (_.activebreakpoint !== null) { _.activebreakpoint = null; _.options = _.originalsettings; if (initial === true) { _.currentslide = _.options.initialslide; } _.refresh(initial); triggerbreakpoint = targetbreakpoint; } } // only trigger breakpoints during an actual break. not on initialize. if( !initial && triggerbreakpoint !== false ) { _.$slider.trigger('breakpoint', [_, triggerbreakpoint]); } } }; slick.prototype.changeslide = function(event, dontanimate) { var _ = this, $target = $(event.target), indexoffset, slideoffset, unevenoffset; // if target is a link, prevent default action. if($target.is('a')) { event.preventdefault(); } // if target is not the
  • element (ie: a child), find the
  • . if(!$target.is('li')) { $target = $target.closest('li'); } unevenoffset = (_.slidecount % _.options.slidestoscroll !== 0); indexoffset = unevenoffset ? 0 : (_.slidecount - _.currentslide) % _.options.slidestoscroll; switch (event.data.message) { case 'previous': slideoffset = indexoffset === 0 ? _.options.slidestoscroll : _.options.slidestoshow - indexoffset; if (_.slidecount > _.options.slidestoshow) { _.slidehandler(_.currentslide - slideoffset, false, dontanimate); } break; case 'next': slideoffset = indexoffset === 0 ? _.options.slidestoscroll : indexoffset; if (_.slidecount > _.options.slidestoshow) { _.slidehandler(_.currentslide + slideoffset, false, dontanimate); } break; case 'index': var index = event.data.index === 0 ? 0 : event.data.index || $target.index() * _.options.slidestoscroll; _.slidehandler(_.checknavigable(index), false, dontanimate); $target.children().trigger('focus'); break; default: return; } }; slick.prototype.checknavigable = function(index) { var _ = this, navigables, prevnavigable; navigables = _.getnavigableindexes(); prevnavigable = 0; if (index > navigables[navigables.length - 1]) { index = navigables[navigables.length - 1]; } else { for (var n in navigables) { if (index < navigables[n]) { index = prevnavigable; break; } prevnavigable = navigables[n]; } } return index; }; slick.prototype.cleanupevents = function() { var _ = this; if (_.options.dots && _.$dots !== null) { $('li', _.$dots).off('click.slick', _.changeslide); if (_.options.pauseondotshover === true && _.options.autoplay === true) { $('li', _.$dots) .off('mouseenter.slick', $.proxy(_.setpaused, _, true)) .off('mouseleave.slick', $.proxy(_.setpaused, _, false)); } } if (_.options.arrows === true && _.slidecount > _.options.slidestoshow) { _.$prevarrow && _.$prevarrow.off('click.slick', _.changeslide); _.$nextarrow && _.$nextarrow.off('click.slick', _.changeslide); } _.$list.off('touchstart.slick mousedown.slick', _.swipehandler); _.$list.off('touchmove.slick mousemove.slick', _.swipehandler); _.$list.off('touchend.slick mouseup.slick', _.swipehandler); _.$list.off('touchcancel.slick mouseleave.slick', _.swipehandler); _.$list.off('click.slick', _.clickhandler); $(document).off(_.visibilitychange, _.visibility); _.$list.off('mouseenter.slick', $.proxy(_.setpaused, _, true)); _.$list.off('mouseleave.slick', $.proxy(_.setpaused, _, false)); if (_.options.accessibility === true) { _.$list.off('keydown.slick', _.keyhandler); } if (_.options.focusonselect === true) { $(_.$slidetrack).children().off('click.slick', _.selecthandler); } $(window).off('orientationchange.slick.slick-' + _.instanceuid, _.orientationchange); $(window).off('resize.slick.slick-' + _.instanceuid, _.resize); $('[draggable!=true]', _.$slidetrack).off('dragstart', _.preventdefault); $(window).off('load.slick.slick-' + _.instanceuid, _.setposition); $(document).off('ready.slick.slick-' + _.instanceuid, _.setposition); }; slick.prototype.cleanuprows = function() { var _ = this, originalslides; if(_.options.rows > 1) { originalslides = _.$slides.children().children(); originalslides.removeattr('style'); _.$slider.html(originalslides); } }; slick.prototype.clickhandler = function(event) { var _ = this; if (_.shouldclick === false) { event.stopimmediatepropagation(); event.stoppropagation(); event.preventdefault(); } }; slick.prototype.destroy = function(refresh) { var _ = this; _.autoplayclear(); _.touchobject = {}; _.cleanupevents(); $('.slick-cloned', _.$slider).detach(); if (_.$dots) { _.$dots.remove(); } if ( _.options.arrows === true ) { if ( _.$prevarrow && _.$prevarrow.length ) { _.$prevarrow .removeclass('slick-disabled slick-arrow slick-hidden') .removeattr('aria-hidden aria-disabled tabindex') .css("display",""); if ( _.htmlexpr.test( _.options.prevarrow )) { _.$prevarrow.remove(); } } if ( _.$nextarrow && _.$nextarrow.length ) { _.$nextarrow .removeclass('slick-disabled slick-arrow slick-hidden') .removeattr('aria-hidden aria-disabled tabindex') .css("display",""); if ( _.htmlexpr.test( _.options.nextarrow )) { _.$nextarrow.remove(); } } } if (_.$slides) { _.$slides .removeclass('slick-slide slick-active slick-center slick-visible slick-current') .removeattr('aria-hidden') .removeattr('data-slick-index') .each(function(){ $(this).attr('style', $(this).data('originalstyling')); }); _.$slidetrack.children(this.options.slide).detach(); _.$slidetrack.detach(); _.$list.detach(); _.$slider.append(_.$slides); } _.cleanuprows(); _.$slider.removeclass('slick-slider'); _.$slider.removeclass('slick-initialized'); _.unslicked = true; if(!refresh) { _.$slider.trigger('destroy', [_]); } }; slick.prototype.disabletransition = function(slide) { var _ = this, transition = {}; transition[_.transitiontype] = ''; if (_.options.fade === false) { _.$slidetrack.css(transition); } else { _.$slides.eq(slide).css(transition); } }; slick.prototype.fadeslide = function(slideindex, callback) { var _ = this; if (_.csstransitions === false) { _.$slides.eq(slideindex).css({ zindex: _.options.zindex }); _.$slides.eq(slideindex).animate({ opacity: 1 }, _.options.speed, _.options.easing, callback); } else { _.applytransition(slideindex); _.$slides.eq(slideindex).css({ opacity: 1, zindex: _.options.zindex }); if (callback) { settimeout(function() { _.disabletransition(slideindex); callback.call(); }, _.options.speed); } } }; slick.prototype.fadeslideout = function(slideindex) { var _ = this; if (_.csstransitions === false) { _.$slides.eq(slideindex).animate({ opacity: 0, zindex: _.options.zindex - 2 }, _.options.speed, _.options.easing); } else { _.applytransition(slideindex); _.$slides.eq(slideindex).css({ opacity: 0, zindex: _.options.zindex - 2 }); } }; slick.prototype.filterslides = slick.prototype.slickfilter = function(filter) { var _ = this; if (filter !== null) { _.unload(); _.$slidetrack.children(this.options.slide).detach(); _.$slidescache.filter(filter).appendto(_.$slidetrack); _.reinit(); } }; slick.prototype.getcurrent = slick.prototype.slickcurrentslide = function() { var _ = this; return _.currentslide; }; slick.prototype.getdotcount = function() { var _ = this; var breakpoint = 0; var counter = 0; var pagerqty = 0; if (_.options.infinite === true) { while (breakpoint < _.slidecount) { ++pagerqty; breakpoint = counter + _.options.slidestoshow; counter += _.options.slidestoscroll <= _.options.slidestoshow ? _.options.slidestoscroll : _.options.slidestoshow; } } else if (_.options.centermode === true) { pagerqty = _.slidecount; } else { while (breakpoint < _.slidecount) { ++pagerqty; breakpoint = counter + _.options.slidestoshow; counter += _.options.slidestoscroll <= _.options.slidestoshow ? _.options.slidestoscroll : _.options.slidestoshow; } } return pagerqty - 1; }; slick.prototype.getleft = function(slideindex) { var _ = this, targetleft, verticalheight, verticaloffset = 0, targetslide; _.slideoffset = 0; verticalheight = _.$slides.first().outerheight(true); if (_.options.infinite === true) { if (_.slidecount > _.options.slidestoshow) { _.slideoffset = (_.slidewidth * _.options.slidestoshow) * -1; verticaloffset = (verticalheight * _.options.slidestoshow) * -1; } if (_.slidecount % _.options.slidestoscroll !== 0) { if (slideindex + _.options.slidestoscroll > _.slidecount && _.slidecount > _.options.slidestoshow) { if (slideindex > _.slidecount) { _.slideoffset = ((_.options.slidestoshow - (slideindex - _.slidecount)) * _.slidewidth) * -1; verticaloffset = ((_.options.slidestoshow - (slideindex - _.slidecount)) * verticalheight) * -1; } else { _.slideoffset = ((_.slidecount % _.options.slidestoscroll) * _.slidewidth) * -1; verticaloffset = ((_.slidecount % _.options.slidestoscroll) * verticalheight) * -1; } } } } else { if (slideindex + _.options.slidestoshow > _.slidecount) { _.slideoffset = ((slideindex + _.options.slidestoshow) - _.slidecount) * _.slidewidth; verticaloffset = ((slideindex + _.options.slidestoshow) - _.slidecount) * verticalheight; } } if (_.slidecount <= _.options.slidestoshow) { _.slideoffset = 0; verticaloffset = 0; } if (_.options.centermode === true && _.options.infinite === true) { _.slideoffset += _.slidewidth * math.floor(_.options.slidestoshow / 2) - _.slidewidth; } else if (_.options.centermode === true) { _.slideoffset = 0; _.slideoffset += _.slidewidth * math.floor(_.options.slidestoshow / 2); } if (_.options.vertical === false) { targetleft = ((slideindex * _.slidewidth) * -1) + _.slideoffset; } else { targetleft = ((slideindex * verticalheight) * -1) + verticaloffset; } if (_.options.variablewidth === true) { if (_.slidecount <= _.options.slidestoshow || _.options.infinite === false) { targetslide = _.$slidetrack.children('.slick-slide').eq(slideindex); } else { targetslide = _.$slidetrack.children('.slick-slide').eq(slideindex + _.options.slidestoshow); } targetleft = targetslide[0] ? targetslide[0].offsetleft * -1 : 0; if (_.options.centermode === true) { if (_.options.infinite === false) { targetslide = _.$slidetrack.children('.slick-slide').eq(slideindex); } else { targetslide = _.$slidetrack.children('.slick-slide').eq(slideindex + _.options.slidestoshow + 1); } targetleft = targetslide[0] ? targetslide[0].offsetleft * -1 : 0; targetleft += (_.$list.width() - targetslide.outerwidth()) / 2; } } return targetleft; }; slick.prototype.getoption = slick.prototype.slickgetoption = function(option) { var _ = this; return _.options[option]; }; slick.prototype.getnavigableindexes = function() { var _ = this, breakpoint = 0, counter = 0, indexes = [], max; if (_.options.infinite === false) { max = _.slidecount; } else { breakpoint = _.options.slidestoscroll * -1; counter = _.options.slidestoscroll * -1; max = _.slidecount * 2; } while (breakpoint < max) { indexes.push(breakpoint); breakpoint = counter + _.options.slidestoscroll; counter += _.options.slidestoscroll <= _.options.slidestoshow ? _.options.slidestoscroll : _.options.slidestoshow; } return indexes; }; slick.prototype.getslick = function() { return this; }; slick.prototype.getslidecount = function() { var _ = this, slidestraversed, swipedslide, centeroffset; centeroffset = _.options.centermode === true ? _.slidewidth * math.floor(_.options.slidestoshow / 2) : 0; if (_.options.swipetoslide === true) { _.$slidetrack.find('.slick-slide').each(function(index, slide) { if (slide.offsetleft - centeroffset + ($(slide).outerwidth() / 2) > (_.swipeleft * -1)) { swipedslide = slide; return false; } }); slidestraversed = math.abs($(swipedslide).attr('data-slick-index') - _.currentslide) || 1; return slidestraversed; } else { return _.options.slidestoscroll; } }; slick.prototype.goto = slick.prototype.slickgoto = function(slide, dontanimate) { var _ = this; _.changeslide({ data: { message: 'index', index: parseint(slide) } }, dontanimate); }; slick.prototype.init = function(creation) { var _ = this; if (!$(_.$slider).hasclass('slick-initialized')) { $(_.$slider).addclass('slick-initialized'); _.buildrows(); _.buildout(); _.setprops(); _.startload(); _.loadslider(); _.initializeevents(); _.updatearrows(); _.updatedots(); } if (creation) { _.$slider.trigger('init', [_]); } if (_.options.accessibility === true) { _.initada(); } }; slick.prototype.initarrowevents = function() { var _ = this; if (_.options.arrows === true && _.slidecount > _.options.slidestoshow) { _.$prevarrow.on('click.slick', { message: 'previous' }, _.changeslide); _.$nextarrow.on('click.slick', { message: 'next' }, _.changeslide); } }; slick.prototype.initdotevents = function() { var _ = this; if (_.options.dots === true && _.slidecount > _.options.slidestoshow) { $('li', _.$dots).on('click.slick', { message: 'index' }, _.changeslide); } if (_.options.dots === true && _.options.pauseondotshover === true && _.options.autoplay === true) { $('li', _.$dots) .on('mouseenter.slick', $.proxy(_.setpaused, _, true)) .on('mouseleave.slick', $.proxy(_.setpaused, _, false)); } }; slick.prototype.initializeevents = function() { var _ = this; _.initarrowevents(); _.initdotevents(); _.$list.on('touchstart.slick mousedown.slick', { action: 'start' }, _.swipehandler); _.$list.on('touchmove.slick mousemove.slick', { action: 'move' }, _.swipehandler); _.$list.on('touchend.slick mouseup.slick', { action: 'end' }, _.swipehandler); _.$list.on('touchcancel.slick mouseleave.slick', { action: 'end' }, _.swipehandler); _.$list.on('click.slick', _.clickhandler); $(document).on(_.visibilitychange, $.proxy(_.visibility, _)); _.$list.on('mouseenter.slick', $.proxy(_.setpaused, _, true)); _.$list.on('mouseleave.slick', $.proxy(_.setpaused, _, false)); if (_.options.accessibility === true) { _.$list.on('keydown.slick', _.keyhandler); } if (_.options.focusonselect === true) { $(_.$slidetrack).children().on('click.slick', _.selecthandler); } $(window).on('orientationchange.slick.slick-' + _.instanceuid, $.proxy(_.orientationchange, _)); $(window).on('resize.slick.slick-' + _.instanceuid, $.proxy(_.resize, _)); $('[draggable!=true]', _.$slidetrack).on('dragstart', _.preventdefault); $(window).on('load.slick.slick-' + _.instanceuid, _.setposition); $(document).on('ready.slick.slick-' + _.instanceuid, _.setposition); }; slick.prototype.initui = function() { var _ = this; if (_.options.arrows === true && _.slidecount > _.options.slidestoshow) { _.$prevarrow.show(); _.$nextarrow.show(); } if (_.options.dots === true && _.slidecount > _.options.slidestoshow) { _.$dots.show(); } if (_.options.autoplay === true) { _.autoplay(); } }; slick.prototype.keyhandler = function(event) { var _ = this; //dont slide if the cursor is inside the form fields and arrow keys are pressed if(!event.target.tagname.match('textarea|input|select')) { if (event.keycode === 37 && _.options.accessibility === true) { _.changeslide({ data: { message: 'previous' } }); } else if (event.keycode === 39 && _.options.accessibility === true) { _.changeslide({ data: { message: 'next' } }); } } }; slick.prototype.lazyload = function() { var _ = this, loadrange, clonerange, rangestart, rangeend; function loadimages(imagesscope) { $('img[data-lazy]', imagesscope).each(function() { var image = $(this), imagesource = $(this).attr('data-lazy'), imagetoload = document.createelement('img'); imagetoload.onload = function() { image .animate({ opacity: 0 }, 100, function() { image .attr('src', imagesource) .animate({ opacity: 1 }, 200, function() { image .removeattr('data-lazy') .removeclass('slick-loading'); }); }); }; imagetoload.src = imagesource; }); } if (_.options.centermode === true) { if (_.options.infinite === true) { rangestart = _.currentslide + (_.options.slidestoshow / 2 + 1); rangeend = rangestart + _.options.slidestoshow + 2; } else { rangestart = math.max(0, _.currentslide - (_.options.slidestoshow / 2 + 1)); rangeend = 2 + (_.options.slidestoshow / 2 + 1) + _.currentslide; } } else { rangestart = _.options.infinite ? _.options.slidestoshow + _.currentslide : _.currentslide; rangeend = rangestart + _.options.slidestoshow; if (_.options.fade === true) { if (rangestart > 0) rangestart--; if (rangeend <= _.slidecount) rangeend++; } } loadrange = _.$slider.find('.slick-slide').slice(rangestart, rangeend); loadimages(loadrange); if (_.slidecount <= _.options.slidestoshow) { clonerange = _.$slider.find('.slick-slide'); loadimages(clonerange); } else if (_.currentslide >= _.slidecount - _.options.slidestoshow) { clonerange = _.$slider.find('.slick-cloned').slice(0, _.options.slidestoshow); loadimages(clonerange); } else if (_.currentslide === 0) { clonerange = _.$slider.find('.slick-cloned').slice(_.options.slidestoshow * -1); loadimages(clonerange); } }; slick.prototype.loadslider = function() { var _ = this; _.setposition(); _.$slidetrack.css({ opacity: 1 }); _.$slider.removeclass('slick-loading'); _.initui(); if (_.options.lazyload === 'progressive') { _.progressivelazyload(); } }; slick.prototype.next = slick.prototype.slicknext = function() { var _ = this; _.changeslide({ data: { message: 'next' } }); }; slick.prototype.orientationchange = function() { var _ = this; _.checkresponsive(); _.setposition(); }; slick.prototype.pause = slick.prototype.slickpause = function() { var _ = this; _.autoplayclear(); _.paused = true; }; slick.prototype.play = slick.prototype.slickplay = function() { var _ = this; _.paused = false; _.autoplay(); }; slick.prototype.postslide = function(index) { var _ = this; _.$slider.trigger('afterchange', [_, index]); _.animating = false; _.setposition(); _.swipeleft = null; if (_.options.autoplay === true && _.paused === false) { _.autoplay(); } if (_.options.accessibility === true) { _.initada(); } }; slick.prototype.prev = slick.prototype.slickprev = function() { var _ = this; _.changeslide({ data: { message: 'previous' } }); }; slick.prototype.preventdefault = function(e) { e.preventdefault(); }; slick.prototype.progressivelazyload = function() { var _ = this, imgcount, targetimage; imgcount = $('img[data-lazy]', _.$slider).length; if (imgcount > 0) { targetimage = $('img[data-lazy]', _.$slider).first(); targetimage.attr('src', targetimage.attr('data-lazy')).removeclass('slick-loading').load(function() { targetimage.removeattr('data-lazy'); _.progressivelazyload(); if (_.options.adaptiveheight === true) { _.setposition(); } }) .error(function() { targetimage.removeattr('data-lazy'); _.progressivelazyload(); }); } }; slick.prototype.refresh = function( initializing ) { var _ = this, currentslide = _.currentslide; _.destroy(true); $.extend(_, _.initials, { currentslide: currentslide }); _.init(); if( !initializing ) { _.changeslide({ data: { message: 'index', index: currentslide } }, false); } }; slick.prototype.registerbreakpoints = function() { var _ = this, breakpoint, currentbreakpoint, l, responsivesettings = _.options.responsive || null; if ( $.type(responsivesettings) === "array" && responsivesettings.length ) { _.respondto = _.options.respondto || 'window'; for ( breakpoint in responsivesettings ) { l = _.breakpoints.length-1; currentbreakpoint = responsivesettings[breakpoint].breakpoint; if (responsivesettings.hasownproperty(breakpoint)) { // loop through the breakpoints and cut out any existing // ones with the same breakpoint number, we don't want dupes. while( l >= 0 ) { if( _.breakpoints[l] && _.breakpoints[l] === currentbreakpoint ) { _.breakpoints.splice(l,1); } l--; } _.breakpoints.push(currentbreakpoint); _.breakpointsettings[currentbreakpoint] = responsivesettings[breakpoint].settings; } } _.breakpoints.sort(function(a, b) { return ( _.options.mobilefirst ) ? a-b : b-a; }); } }; slick.prototype.reinit = function() { var _ = this; _.$slides = _.$slidetrack .children(_.options.slide) .addclass('slick-slide'); _.slidecount = _.$slides.length; if (_.currentslide >= _.slidecount && _.currentslide !== 0) { _.currentslide = _.currentslide - _.options.slidestoscroll; } if (_.slidecount <= _.options.slidestoshow) { _.currentslide = 0; } _.registerbreakpoints(); _.setprops(); _.setupinfinite(); _.buildarrows(); _.updatearrows(); _.initarrowevents(); _.builddots(); _.updatedots(); _.initdotevents(); _.checkresponsive(false, true); if (_.options.focusonselect === true) { $(_.$slidetrack).children().on('click.slick', _.selecthandler); } _.setslideclasses(0); _.setposition(); _.$slider.trigger('reinit', [_]); if (_.options.autoplay === true) { _.focushandler(); } }; slick.prototype.resize = function() { var _ = this; if ($(window).width() !== _.windowwidth) { cleartimeout(_.windowdelay); _.windowdelay = window.settimeout(function() { _.windowwidth = $(window).width(); _.checkresponsive(); if( !_.unslicked ) { _.setposition(); } }, 50); } }; slick.prototype.removeslide = slick.prototype.slickremove = function(index, removebefore, removeall) { var _ = this; if (typeof(index) === 'boolean') { removebefore = index; index = removebefore === true ? 0 : _.slidecount - 1; } else { index = removebefore === true ? --index : index; } if (_.slidecount < 1 || index < 0 || index > _.slidecount - 1) { return false; } _.unload(); if (removeall === true) { _.$slidetrack.children().remove(); } else { _.$slidetrack.children(this.options.slide).eq(index).remove(); } _.$slides = _.$slidetrack.children(this.options.slide); _.$slidetrack.children(this.options.slide).detach(); _.$slidetrack.append(_.$slides); _.$slidescache = _.$slides; _.reinit(); }; slick.prototype.setcss = function(position) { var _ = this, positionprops = {}, x, y; if (_.options.rtl === true) { position = -position; } x = _.positionprop == 'left' ? math.ceil(position) + 'px' : '0px'; y = _.positionprop == 'top' ? math.ceil(position) + 'px' : '0px'; positionprops[_.positionprop] = position; if (_.transformsenabled === false) { _.$slidetrack.css(positionprops); } else { positionprops = {}; if (_.csstransitions === false) { positionprops[_.animtype] = 'translate(' + x + ', ' + y + ')'; _.$slidetrack.css(positionprops); } else { positionprops[_.animtype] = 'translate3d(' + x + ', ' + y + ', 0px)'; _.$slidetrack.css(positionprops); } } }; slick.prototype.setdimensions = function() { var _ = this; if (_.options.vertical === false) { if (_.options.centermode === true) { _.$list.css({ padding: ('0px ' + _.options.centerpadding) }); } } else { _.$list.height(_.$slides.first().outerheight(true) * _.options.slidestoshow); if (_.options.centermode === true) { _.$list.css({ padding: (_.options.centerpadding + ' 0px') }); } } _.listwidth = _.$list.width(); _.listheight = _.$list.height(); if (_.options.vertical === false && _.options.variablewidth === false) { _.slidewidth = math.ceil(_.listwidth / _.options.slidestoshow); _.$slidetrack.width(math.ceil((_.slidewidth * _.$slidetrack.children('.slick-slide').length))); } else if (_.options.variablewidth === true) { _.$slidetrack.width(5000 * _.slidecount); } else { _.slidewidth = math.ceil(_.listwidth); _.$slidetrack.height(math.ceil((_.$slides.first().outerheight(true) * _.$slidetrack.children('.slick-slide').length))); } var offset = _.$slides.first().outerwidth(true) - _.$slides.first().width(); if (_.options.variablewidth === false) _.$slidetrack.children('.slick-slide').width(_.slidewidth - offset); }; slick.prototype.setfade = function() { var _ = this, targetleft; _.$slides.each(function(index, element) { targetleft = (_.slidewidth * index) * -1; if (_.options.rtl === true) { $(element).css({ position: 'relative', right: targetleft, top: 0, zindex: _.options.zindex - 2, opacity: 0 }); } else { $(element).css({ position: 'relative', left: targetleft, top: 0, zindex: _.options.zindex - 2, opacity: 0 }); } }); _.$slides.eq(_.currentslide).css({ zindex: _.options.zindex - 1, opacity: 1 }); }; slick.prototype.setheight = function() { var _ = this; if (_.options.slidestoshow === 1 && _.options.adaptiveheight === true && _.options.vertical === false) { var targetheight = _.$slides.eq(_.currentslide).outerheight(true); _.$list.css('height', targetheight); } }; slick.prototype.setoption = slick.prototype.slicksetoption = function(option, value, refresh) { var _ = this, l, item; if( option === "responsive" && $.type(value) === "array" ) { for ( item in value ) { if( $.type( _.options.responsive ) !== "array" ) { _.options.responsive = [ value[item] ]; } else { l = _.options.responsive.length-1; // loop through the responsive object and splice out duplicates. while( l >= 0 ) { if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { _.options.responsive.splice(l,1); } l--; } _.options.responsive.push( value[item] ); } } } else { _.options[option] = value; } if (refresh === true) { _.unload(); _.reinit(); } }; slick.prototype.setposition = function() { var _ = this; _.setdimensions(); _.setheight(); if (_.options.fade === false) { _.setcss(_.getleft(_.currentslide)); } else { _.setfade(); } _.$slider.trigger('setposition', [_]); }; slick.prototype.setprops = function() { var _ = this, bodystyle = document.body.style; _.positionprop = _.options.vertical === true ? 'top' : 'left'; if (_.positionprop === 'top') { _.$slider.addclass('slick-vertical'); } else { _.$slider.removeclass('slick-vertical'); } if (bodystyle.webkittransition !== undefined || bodystyle.moztransition !== undefined || bodystyle.mstransition !== undefined) { if (_.options.usecss === true) { _.csstransitions = true; } } if ( _.options.fade ) { if ( typeof _.options.zindex === 'number' ) { if( _.options.zindex < 3 ) { _.options.zindex = 3; } } else { _.options.zindex = _.defaults.zindex; } } if (bodystyle.otransform !== undefined) { _.animtype = 'otransform'; _.transformtype = '-o-transform'; _.transitiontype = 'otransition'; if (bodystyle.perspectiveproperty === undefined && bodystyle.webkitperspective === undefined) _.animtype = false; } if (bodystyle.moztransform !== undefined) { _.animtype = 'moztransform'; _.transformtype = '-moz-transform'; _.transitiontype = 'moztransition'; if (bodystyle.perspectiveproperty === undefined && bodystyle.mozperspective === undefined) _.animtype = false; } if (bodystyle.webkittransform !== undefined) { _.animtype = 'webkittransform'; _.transformtype = '-webkit-transform'; _.transitiontype = 'webkittransition'; if (bodystyle.perspectiveproperty === undefined && bodystyle.webkitperspective === undefined) _.animtype = false; } if (bodystyle.mstransform !== undefined) { _.animtype = 'mstransform'; _.transformtype = '-ms-transform'; _.transitiontype = 'mstransition'; if (bodystyle.mstransform === undefined) _.animtype = false; } if (bodystyle.transform !== undefined && _.animtype !== false) { _.animtype = 'transform'; _.transformtype = 'transform'; _.transitiontype = 'transition'; } _.transformsenabled = (_.animtype !== null && _.animtype !== false); }; slick.prototype.setslideclasses = function(index) { var _ = this, centeroffset, allslides, indexoffset, remainder; allslides = _.$slider .find('.slick-slide') .removeclass('slick-active slick-center slick-current') .attr('aria-hidden', 'true'); _.$slides .eq(index) .addclass('slick-current'); if (_.options.centermode === true) { centeroffset = math.floor(_.options.slidestoshow / 2); if (_.options.infinite === true) { if (index >= centeroffset && index <= (_.slidecount - 1) - centeroffset) { _.$slides .slice(index - centeroffset, index + centeroffset + 1) .addclass('slick-active') .attr('aria-hidden', 'false'); } else { indexoffset = _.options.slidestoshow + index; allslides .slice(indexoffset - centeroffset + 1, indexoffset + centeroffset + 2) .addclass('slick-active') .attr('aria-hidden', 'false'); } if (index === 0) { allslides .eq(allslides.length - 1 - _.options.slidestoshow) .addclass('slick-center'); } else if (index === _.slidecount - 1) { allslides .eq(_.options.slidestoshow) .addclass('slick-center'); } } _.$slides .eq(index) .addclass('slick-center'); } else { if (index >= 0 && index <= (_.slidecount - _.options.slidestoshow)) { _.$slides .slice(index, index + _.options.slidestoshow) .addclass('slick-active') .attr('aria-hidden', 'false'); } else if (allslides.length <= _.options.slidestoshow) { allslides .addclass('slick-active') .attr('aria-hidden', 'false'); } else { remainder = _.slidecount % _.options.slidestoshow; indexoffset = _.options.infinite === true ? _.options.slidestoshow + index : index; if (_.options.slidestoshow == _.options.slidestoscroll && (_.slidecount - index) < _.options.slidestoshow) { allslides .slice(indexoffset - (_.options.slidestoshow - remainder), indexoffset + remainder) .addclass('slick-active') .attr('aria-hidden', 'false'); } else { allslides .slice(indexoffset, indexoffset + _.options.slidestoshow) .addclass('slick-active') .attr('aria-hidden', 'false'); } } } if (_.options.lazyload === 'ondemand') { _.lazyload(); } }; slick.prototype.setupinfinite = function() { var _ = this, i, slideindex, infinitecount; if (_.options.fade === true) { _.options.centermode = false; } if (_.options.infinite === true && _.options.fade === false) { slideindex = null; if (_.slidecount > _.options.slidestoshow) { if (_.options.centermode === true) { infinitecount = _.options.slidestoshow + 1; } else { infinitecount = _.options.slidestoshow; } for (i = _.slidecount; i > (_.slidecount - infinitecount); i -= 1) { slideindex = i - 1; $(_.$slides[slideindex]).clone(true).attr('id', '') .attr('data-slick-index', slideindex - _.slidecount) .prependto(_.$slidetrack).addclass('slick-cloned'); } for (i = 0; i < infinitecount; i += 1) { slideindex = i; $(_.$slides[slideindex]).clone(true).attr('id', '') .attr('data-slick-index', slideindex + _.slidecount) .appendto(_.$slidetrack).addclass('slick-cloned'); } _.$slidetrack.find('.slick-cloned').find('[id]').each(function() { $(this).attr('id', ''); }); } } }; slick.prototype.setpaused = function(paused) { var _ = this; if (_.options.autoplay === true && _.options.pauseonhover === true) { _.paused = paused; if (!paused) { _.autoplay(); } else { _.autoplayclear(); } } }; slick.prototype.selecthandler = function(event) { var _ = this; var targetelement = $(event.target).is('.slick-slide') ? $(event.target) : $(event.target).parents('.slick-slide'); var index = parseint(targetelement.attr('data-slick-index')); if (!index) index = 0; if (_.slidecount <= _.options.slidestoshow) { _.setslideclasses(index); _.asnavfor(index); return; } _.slidehandler(index); }; slick.prototype.slidehandler = function(index, sync, dontanimate) { var targetslide, animslide, oldslide, slideleft, targetleft = null, _ = this; sync = sync || false; if (_.animating === true && _.options.waitforanimate === true) { return; } if (_.options.fade === true && _.currentslide === index) { return; } if (_.slidecount <= _.options.slidestoshow) { return; } if (sync === false) { _.asnavfor(index); } targetslide = index; targetleft = _.getleft(targetslide); slideleft = _.getleft(_.currentslide); _.currentleft = _.swipeleft === null ? slideleft : _.swipeleft; if (_.options.infinite === false && _.options.centermode === false && (index < 0 || index > _.getdotcount() * _.options.slidestoscroll)) { if (_.options.fade === false) { targetslide = _.currentslide; if (dontanimate !== true) { _.animateslide(slideleft, function() { _.postslide(targetslide); }); } else { _.postslide(targetslide); } } return; } else if (_.options.infinite === false && _.options.centermode === true && (index < 0 || index > (_.slidecount - _.options.slidestoscroll))) { if (_.options.fade === false) { targetslide = _.currentslide; if (dontanimate !== true) { _.animateslide(slideleft, function() { _.postslide(targetslide); }); } else { _.postslide(targetslide); } } return; } if (_.options.autoplay === true) { clearinterval(_.autoplaytimer); } if (targetslide < 0) { if (_.slidecount % _.options.slidestoscroll !== 0) { animslide = _.slidecount - (_.slidecount % _.options.slidestoscroll); } else { animslide = _.slidecount + targetslide; } } else if (targetslide >= _.slidecount) { if (_.slidecount % _.options.slidestoscroll !== 0) { animslide = 0; } else { animslide = targetslide - _.slidecount; } } else { animslide = targetslide; } _.animating = true; _.$slider.trigger('beforechange', [_, _.currentslide, animslide]); oldslide = _.currentslide; _.currentslide = animslide; _.setslideclasses(_.currentslide); _.updatedots(); _.updatearrows(); if (_.options.fade === true) { if (dontanimate !== true) { _.fadeslideout(oldslide); _.fadeslide(animslide, function() { _.postslide(animslide); }); } else { _.postslide(animslide); } _.animateheight(); return; } if (dontanimate !== true) { _.animateslide(targetleft, function() { _.postslide(animslide); }); } else { _.postslide(animslide); } }; slick.prototype.startload = function() { var _ = this; if (_.options.arrows === true && _.slidecount > _.options.slidestoshow) { _.$prevarrow.hide(); _.$nextarrow.hide(); } if (_.options.dots === true && _.slidecount > _.options.slidestoshow) { _.$dots.hide(); } _.$slider.addclass('slick-loading'); }; slick.prototype.swipedirection = function() { var xdist, ydist, r, swipeangle, _ = this; xdist = _.touchobject.startx - _.touchobject.curx; ydist = _.touchobject.starty - _.touchobject.cury; r = math.atan2(ydist, xdist); swipeangle = math.round(r * 180 / math.pi); if (swipeangle < 0) { swipeangle = 360 - math.abs(swipeangle); } if ((swipeangle <= 45) && (swipeangle >= 0)) { return (_.options.rtl === false ? 'left' : 'right'); } if ((swipeangle <= 360) && (swipeangle >= 315)) { return (_.options.rtl === false ? 'left' : 'right'); } if ((swipeangle >= 135) && (swipeangle <= 225)) { return (_.options.rtl === false ? 'right' : 'left'); } if (_.options.verticalswiping === true) { if ((swipeangle >= 35) && (swipeangle <= 135)) { return 'left'; } else { return 'right'; } } return 'vertical'; }; slick.prototype.swipeend = function(event) { var _ = this, slidecount; _.dragging = false; _.shouldclick = (_.touchobject.swipelength > 10) ? false : true; if (_.touchobject.curx === undefined) { return false; } if (_.touchobject.edgehit === true) { _.$slider.trigger('edge', [_, _.swipedirection()]); } if (_.touchobject.swipelength >= _.touchobject.minswipe) { switch (_.swipedirection()) { case 'left': slidecount = _.options.swipetoslide ? _.checknavigable(_.currentslide + _.getslidecount()) : _.currentslide + _.getslidecount(); _.slidehandler(slidecount); _.currentdirection = 0; _.touchobject = {}; _.$slider.trigger('swipe', [_, 'left']); break; case 'right': slidecount = _.options.swipetoslide ? _.checknavigable(_.currentslide - _.getslidecount()) : _.currentslide - _.getslidecount(); _.slidehandler(slidecount); _.currentdirection = 1; _.touchobject = {}; _.$slider.trigger('swipe', [_, 'right']); break; } } else { if (_.touchobject.startx !== _.touchobject.curx) { _.slidehandler(_.currentslide); _.touchobject = {}; } } }; slick.prototype.swipehandler = function(event) { var _ = this; if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { return; } else if (_.options.draggable === false && event.type.indexof('mouse') !== -1) { return; } _.touchobject.fingercount = event.originalevent && event.originalevent.touches !== undefined ? event.originalevent.touches.length : 1; _.touchobject.minswipe = _.listwidth / _.options .touchthreshold; if (_.options.verticalswiping === true) { _.touchobject.minswipe = _.listheight / _.options .touchthreshold; } switch (event.data.action) { case 'start': _.swipestart(event); break; case 'move': _.swipemove(event); break; case 'end': _.swipeend(event); break; } }; slick.prototype.swipemove = function(event) { var _ = this, edgewashit = false, curleft, swipedirection, swipelength, positionoffset, touches; touches = event.originalevent !== undefined ? event.originalevent.touches : null; if (!_.dragging || touches && touches.length !== 1) { return false; } curleft = _.getleft(_.currentslide); _.touchobject.curx = touches !== undefined ? touches[0].pagex : event.clientx; _.touchobject.cury = touches !== undefined ? touches[0].pagey : event.clienty; _.touchobject.swipelength = math.round(math.sqrt( math.pow(_.touchobject.curx - _.touchobject.startx, 2))); if (_.options.verticalswiping === true) { _.touchobject.swipelength = math.round(math.sqrt( math.pow(_.touchobject.cury - _.touchobject.starty, 2))); } swipedirection = _.swipedirection(); if (swipedirection === 'vertical') { return; } if (event.originalevent !== undefined && _.touchobject.swipelength > 4) { event.preventdefault(); } positionoffset = (_.options.rtl === false ? 1 : -1) * (_.touchobject.curx > _.touchobject.startx ? 1 : -1); if (_.options.verticalswiping === true) { positionoffset = _.touchobject.cury > _.touchobject.starty ? 1 : -1; } swipelength = _.touchobject.swipelength; _.touchobject.edgehit = false; if (_.options.infinite === false) { if ((_.currentslide === 0 && swipedirection === 'right') || (_.currentslide >= _.getdotcount() && swipedirection === 'left')) { swipelength = _.touchobject.swipelength * _.options.edgefriction; _.touchobject.edgehit = true; } } if (_.options.vertical === false) { _.swipeleft = curleft + swipelength * positionoffset; } else { _.swipeleft = curleft + (swipelength * (_.$list.height() / _.listwidth)) * positionoffset; } if (_.options.verticalswiping === true) { _.swipeleft = curleft + swipelength * positionoffset; } if (_.options.fade === true || _.options.touchmove === false) { return false; } if (_.animating === true) { _.swipeleft = null; return false; } _.setcss(_.swipeleft); }; slick.prototype.swipestart = function(event) { var _ = this, touches; if (_.touchobject.fingercount !== 1 || _.slidecount <= _.options.slidestoshow) { _.touchobject = {}; return false; } if (event.originalevent !== undefined && event.originalevent.touches !== undefined) { touches = event.originalevent.touches[0]; } _.touchobject.startx = _.touchobject.curx = touches !== undefined ? touches.pagex : event.clientx; _.touchobject.starty = _.touchobject.cury = touches !== undefined ? touches.pagey : event.clienty; _.dragging = true; }; slick.prototype.unfilterslides = slick.prototype.slickunfilter = function() { var _ = this; if (_.$slidescache !== null) { _.unload(); _.$slidetrack.children(this.options.slide).detach(); _.$slidescache.appendto(_.$slidetrack); _.reinit(); } }; slick.prototype.unload = function() { var _ = this; $('.slick-cloned', _.$slider).remove(); if (_.$dots) { _.$dots.remove(); } if (_.$prevarrow && _.htmlexpr.test(_.options.prevarrow)) { _.$prevarrow.remove(); } if (_.$nextarrow && _.htmlexpr.test(_.options.nextarrow)) { _.$nextarrow.remove(); } _.$slides .removeclass('slick-slide slick-active slick-visible slick-current') .attr('aria-hidden', 'true') .css('width', ''); }; slick.prototype.unslick = function(frombreakpoint) { var _ = this; _.$slider.trigger('unslick', [_, frombreakpoint]); _.destroy(); }; slick.prototype.updatearrows = function() { var _ = this, centeroffset; centeroffset = math.floor(_.options.slidestoshow / 2); if ( _.options.arrows === true && _.slidecount > _.options.slidestoshow && !_.options.infinite ) { _.$prevarrow.removeclass('slick-disabled').attr('aria-disabled', 'false'); _.$nextarrow.removeclass('slick-disabled').attr('aria-disabled', 'false'); if (_.currentslide === 0) { _.$prevarrow.addclass('slick-disabled').attr('aria-disabled', 'true'); _.$nextarrow.removeclass('slick-disabled').attr('aria-disabled', 'false'); } else if (_.currentslide >= _.slidecount - _.options.slidestoshow && _.options.centermode === false) { _.$nextarrow.addclass('slick-disabled').attr('aria-disabled', 'true'); _.$prevarrow.removeclass('slick-disabled').attr('aria-disabled', 'false'); } else if (_.currentslide >= _.slidecount - 1 && _.options.centermode === true) { _.$nextarrow.addclass('slick-disabled').attr('aria-disabled', 'true'); _.$prevarrow.removeclass('slick-disabled').attr('aria-disabled', 'false'); } } }; slick.prototype.updatedots = function() { var _ = this; if (_.$dots !== null) { _.$dots .find('li') .removeclass('slick-active') .attr('aria-hidden', 'true'); _.$dots .find('li') .eq(math.floor(_.currentslide / _.options.slidestoscroll)) .addclass('slick-active') .attr('aria-hidden', 'false'); } }; slick.prototype.visibility = function() { var _ = this; if (document[_.hidden]) { _.paused = true; _.autoplayclear(); } else { if (_.options.autoplay === true) { _.paused = false; _.autoplay(); } } }; slick.prototype.initada = function() { var _ = this; _.$slides.add(_.$slidetrack.find('.slick-cloned')).attr({ 'aria-hidden': 'true', 'tabindex': '-1' }).find('a, input, button, select').attr({ 'tabindex': '-1' }); _.$slidetrack.attr('role', 'listbox'); _.$slides.not(_.$slidetrack.find('.slick-cloned')).each(function(i) { $(this).attr({ 'role': 'option', 'aria-describedby': 'slick-slide' + _.instanceuid + i + '' }); }); if (_.$dots !== null) { _.$dots.attr('role', 'tablist').find('li').each(function(i) { $(this).attr({ 'role': 'presentation', 'aria-selected': 'false', 'aria-controls': 'navigation' + _.instanceuid + i + '', 'id': 'slick-slide' + _.instanceuid + i + '' }); }) .first().attr('aria-selected', 'true').end() .find('button').attr('role', 'button').end() .closest('div').attr('role', 'toolbar'); } _.activateada(); }; slick.prototype.activateada = function() { var _ = this, _isslideonfocus =_.$slider.find('*').is(':focus'); // _isslideonfocus = _.$slides.is(':focus') || _.$slides.find('*').is(':focus'); _.$slidetrack.find('.slick-active').attr({ 'aria-hidden': 'false', 'tabindex': '0' }).find('a, input, button, select').attr({ 'tabindex': '0' }); (_isslideonfocus) && _.$slidetrack.find('.slick-active').focus(); }; slick.prototype.focushandler = function() { var _ = this; _.$slider.on('focus.slick blur.slick', '*', function(event) { event.stopimmediatepropagation(); var sf = $(this); settimeout(function() { if (_.isplay) { if (sf.is(':focus')) { _.autoplayclear(); _.paused = true; } else { _.paused = false; _.autoplay(); } } }, 0); }); }; $.fn.slick = function() { var _ = this, opt = arguments[0], args = array.prototype.slice.call(arguments, 1), l = _.length, i = 0, ret; for (i; i < l; i++) { if (typeof opt == 'object' || typeof opt == 'undefined') _[i].slick = new slick(_[i], opt); else ret = _[i].slick[opt].apply(_[i].slick, args); if (typeof ret != 'undefined') return ret; } return _; }; })); /* * jquery owlcarousel v1.3.3 * * copyright (c) 2013 bartosz wojciechowski * http://www.owlgraphic.com/owlcarousel/ * * licensed under mit * */ /*js lint helpers: */ /*global dragmove: false, dragend: false, $, jquery, alert, window, document */ /*jslint nomen: true, continue:true */ if (typeof object.create !== "function") { object.create = function (obj) { function f() {} f.prototype = obj; return new f(); }; } (function ($, window, document) { var carousel = { init : function (options, el) { var base = this; base.$elem = $(el); base.options = $.extend({}, $.fn.owlcarousel.options, base.$elem.data(), options); base.useroptions = options; base.loadcontent(); }, loadcontent : function () { var base = this, url; function getdata(data) { var i, content = ""; if (typeof base.options.jsonsuccess === "function") { base.options.jsonsuccess.apply(this, [data]); } else { for (i in data.owl) { if (data.owl.hasownproperty(i)) { content += data.owl[i].item; } } base.$elem.html(content); } base.login(); } if (typeof base.options.beforeinit === "function") { base.options.beforeinit.apply(this, [base.$elem]); } if (typeof base.options.jsonpath === "string") { url = base.options.jsonpath; $.getjson(url, getdata); } else { base.login(); } }, login : function () { var base = this; base.$elem.data("owl-originalstyles", base.$elem.attr("style")); base.$elem.data("owl-originalclasses", base.$elem.attr("class")); base.$elem.css({opacity: 0}); base.orignalitems = base.options.items; base.checkbrowser(); base.wrapperwidth = 0; base.checkvisible = null; base.setvars(); }, setvars : function () { var base = this; if (base.$elem.children().length === 0) {return false; } base.baseclass(); base.eventtypes(); base.$useritems = base.$elem.children(); base.itemsamount = base.$useritems.length; base.wrapitems(); base.$owlitems = base.$elem.find(".owl-item"); base.$owlwrapper = base.$elem.find(".owl-wrapper"); base.playdirection = "next"; base.previtem = 0; base.prevarr = [0]; base.currentitem = 0; base.customevents(); base.onstartup(); }, onstartup : function () { var base = this; base.updateitems(); base.calculateall(); base.buildcontrols(); base.updatecontrols(); base.response(); base.moveevents(); base.stoponhover(); base.owlstatus(); if (base.options.transitionstyle !== false) { base.transitiontypes(base.options.transitionstyle); } if (base.options.autoplay === true) { base.options.autoplay = 5000; } base.play(); base.$elem.find(".owl-wrapper").css("display", "block"); if (!base.$elem.is(":visible")) { base.watchvisibility(); } else { base.$elem.css("opacity", 1); } base.onstartup = false; base.eachmoveupdate(); if (typeof base.options.afterinit === "function") { base.options.afterinit.apply(this, [base.$elem]); } }, eachmoveupdate : function () { var base = this; if (base.options.lazyload === true) { base.lazyload(); } if (base.options.autoheight === true) { base.autoheight(); } base.onvisibleitems(); if (typeof base.options.afteraction === "function") { base.options.afteraction.apply(this, [base.$elem]); } }, updatevars : function () { var base = this; if (typeof base.options.beforeupdate === "function") { base.options.beforeupdate.apply(this, [base.$elem]); } base.watchvisibility(); base.updateitems(); base.calculateall(); base.updateposition(); base.updatecontrols(); base.eachmoveupdate(); if (typeof base.options.afterupdate === "function") { base.options.afterupdate.apply(this, [base.$elem]); } }, reload : function () { var base = this; window.settimeout(function () { base.updatevars(); }, 0); }, watchvisibility : function () { var base = this; if (base.$elem.is(":visible") === false) { base.$elem.css({opacity: 0}); window.clearinterval(base.autoplayinterval); window.clearinterval(base.checkvisible); } else { return false; } base.checkvisible = window.setinterval(function () { if (base.$elem.is(":visible")) { base.reload(); base.$elem.animate({opacity: 1}, 200); window.clearinterval(base.checkvisible); } }, 500); }, wrapitems : function () { var base = this; base.$useritems.wrapall("
    ").wrap("
    "); base.$elem.find(".owl-wrapper").wrap("
    "); base.wrapperouter = base.$elem.find(".owl-wrapper-outer"); base.$elem.css("display", "block"); }, baseclass : function () { var base = this, hasbaseclass = base.$elem.hasclass(base.options.baseclass), hasthemeclass = base.$elem.hasclass(base.options.theme); if (!hasbaseclass) { base.$elem.addclass(base.options.baseclass); } if (!hasthemeclass) { base.$elem.addclass(base.options.theme); } }, updateitems : function () { var base = this, width, i; if (base.options.responsive === false) { return false; } if (base.options.singleitem === true) { base.options.items = base.orignalitems = 1; base.options.itemscustom = false; base.options.itemsdesktop = false; base.options.itemsdesktopsmall = false; base.options.itemstablet = false; base.options.itemstabletsmall = false; base.options.itemsmobile = false; return false; } width = $(base.options.responsivebasewidth).width(); if (width > (base.options.itemsdesktop[0] || base.orignalitems)) { base.options.items = base.orignalitems; } if (base.options.itemscustom !== false) { //reorder array by screen size base.options.itemscustom.sort(function (a, b) {return a[0] - b[0]; }); for (i = 0; i < base.options.itemscustom.length; i += 1) { if (base.options.itemscustom[i][0] <= width) { base.options.items = base.options.itemscustom[i][1]; } } } else { if (width <= base.options.itemsdesktop[0] && base.options.itemsdesktop !== false) { base.options.items = base.options.itemsdesktop[1]; } if (width <= base.options.itemsdesktopsmall[0] && base.options.itemsdesktopsmall !== false) { base.options.items = base.options.itemsdesktopsmall[1]; } if (width <= base.options.itemstablet[0] && base.options.itemstablet !== false) { base.options.items = base.options.itemstablet[1]; } if (width <= base.options.itemstabletsmall[0] && base.options.itemstabletsmall !== false) { base.options.items = base.options.itemstabletsmall[1]; } if (width <= base.options.itemsmobile[0] && base.options.itemsmobile !== false) { base.options.items = base.options.itemsmobile[1]; } } //if number of items is less than declared if (base.options.items > base.itemsamount && base.options.itemsscaleup === true) { base.options.items = base.itemsamount; } }, response : function () { var base = this, smalldelay, lastwindowwidth; if (base.options.responsive !== true) { return false; } lastwindowwidth = $(window).width(); base.resizer = function () { if ($(window).width() !== lastwindowwidth) { if (base.options.autoplay !== false) { window.clearinterval(base.autoplayinterval); } window.cleartimeout(smalldelay); smalldelay = window.settimeout(function () { lastwindowwidth = $(window).width(); base.updatevars(); }, base.options.responsiverefreshrate); } }; $(window).resize(base.resizer); }, updateposition : function () { var base = this; base.jumpto(base.currentitem); if (base.options.autoplay !== false) { base.checkap(); } }, appenditemssizes : function () { var base = this, roundpages = 0, lastitem = base.itemsamount - base.options.items; base.$owlitems.each(function (index) { var $this = $(this); $this .css({"width": base.itemwidth}) .data("owl-item", number(index)); if (index % base.options.items === 0 || index === lastitem) { if (!(index > lastitem)) { roundpages += 1; } } $this.data("owl-roundpages", roundpages); }); }, appendwrappersizes : function () { var base = this, width = base.$owlitems.length * base.itemwidth; base.$owlwrapper.css({ "width": width * 2, "left": 0 }); base.appenditemssizes(); }, calculateall : function () { var base = this; base.calculatewidth(); base.appendwrappersizes(); base.loops(); base.max(); }, calculatewidth : function () { var base = this; base.itemwidth = math.round(base.$elem.width() / base.options.items); }, max : function () { var base = this, maximum = ((base.itemsamount * base.itemwidth) - base.options.items * base.itemwidth) * -1; if (base.options.items > base.itemsamount) { base.maximumitem = 0; maximum = 0; base.maximumpixels = 0; } else { base.maximumitem = base.itemsamount - base.options.items; base.maximumpixels = maximum; } return maximum; }, min : function () { return 0; }, loops : function () { var base = this, prev = 0, elwidth = 0, i, item, roundpagenum; base.positionsinarray = [0]; base.pagesinarray = []; for (i = 0; i < base.itemsamount; i += 1) { elwidth += base.itemwidth; base.positionsinarray.push(-elwidth); if (base.options.scrollperpage === true) { item = $(base.$owlitems[i]); roundpagenum = item.data("owl-roundpages"); if (roundpagenum !== prev) { base.pagesinarray[prev] = base.positionsinarray[i]; prev = roundpagenum; } } } }, buildcontrols : function () { var base = this; if (base.options.navigation === true || base.options.pagination === true) { base.owlcontrols = $("
    ").toggleclass("clickable", !base.browser.istouch).appendto(base.$elem); } if (base.options.pagination === true) { base.buildpagination(); } if (base.options.navigation === true) { base.buildbuttons(); } }, buildbuttons : function () { var base = this, buttonswrapper = $("
    "); base.owlcontrols.append(buttonswrapper); base.buttonprev = $("
    ", { "class" : "owl-prev", "html" : base.options.navigationtext[0] || "" }); base.buttonnext = $("
    ", { "class" : "owl-next", "html" : base.options.navigationtext[1] || "" }); buttonswrapper .append(base.buttonprev) .append(base.buttonnext); buttonswrapper.on("touchstart.owlcontrols mousedown.owlcontrols", "div[class^=\"owl\"]", function (event) { event.preventdefault(); }); buttonswrapper.on("touchend.owlcontrols mouseup.owlcontrols", "div[class^=\"owl\"]", function (event) { event.preventdefault(); if ($(this).hasclass("owl-next")) { base.next(); } else { base.prev(); } }); }, buildpagination : function () { var base = this; base.paginationwrapper = $("
    "); base.owlcontrols.append(base.paginationwrapper); base.paginationwrapper.on("touchend.owlcontrols mouseup.owlcontrols", ".owl-page", function (event) { event.preventdefault(); if (number($(this).data("owl-page")) !== base.currentitem) { base.goto(number($(this).data("owl-page")), true); } }); }, updatepagination : function () { var base = this, counter, lastpage, lastitem, i, paginationbutton, paginationbuttoninner; if (base.options.pagination === false) { return false; } base.paginationwrapper.html(""); counter = 0; lastpage = base.itemsamount - base.itemsamount % base.options.items; for (i = 0; i < base.itemsamount; i += 1) { if (i % base.options.items === 0) { counter += 1; if (lastpage === i) { lastitem = base.itemsamount - base.options.items; } paginationbutton = $("
    ", { "class" : "owl-page" }); paginationbuttoninner = $("", { "text": base.options.paginationnumbers === true ? counter : "", "class": base.options.paginationnumbers === true ? "owl-numbers" : "" }); paginationbutton.append(paginationbuttoninner); paginationbutton.data("owl-page", lastpage === i ? lastitem : i); paginationbutton.data("owl-roundpages", counter); base.paginationwrapper.append(paginationbutton); } } base.checkpagination(); }, checkpagination : function () { var base = this; if (base.options.pagination === false) { return false; } base.paginationwrapper.find(".owl-page").each(function () { if ($(this).data("owl-roundpages") === $(base.$owlitems[base.currentitem]).data("owl-roundpages")) { base.paginationwrapper .find(".owl-page") .removeclass("active"); $(this).addclass("active"); } }); }, checknavigation : function () { var base = this; if (base.options.navigation === false) { return false; } if (base.options.rewindnav === false) { if (base.currentitem === 0 && base.maximumitem === 0) { base.buttonprev.addclass("disabled"); base.buttonnext.addclass("disabled"); } else if (base.currentitem === 0 && base.maximumitem !== 0) { base.buttonprev.addclass("disabled"); base.buttonnext.removeclass("disabled"); } else if (base.currentitem === base.maximumitem) { base.buttonprev.removeclass("disabled"); base.buttonnext.addclass("disabled"); } else if (base.currentitem !== 0 && base.currentitem !== base.maximumitem) { base.buttonprev.removeclass("disabled"); base.buttonnext.removeclass("disabled"); } } }, updatecontrols : function () { var base = this; base.updatepagination(); base.checknavigation(); if (base.owlcontrols) { if (base.options.items >= base.itemsamount) { base.owlcontrols.hide(); } else { base.owlcontrols.show(); } } }, destroycontrols : function () { var base = this; if (base.owlcontrols) { base.owlcontrols.remove(); } }, next : function (speed) { var base = this; if (base.istransition) { return false; } base.currentitem += base.options.scrollperpage === true ? base.options.items : 1; if (base.currentitem > base.maximumitem + (base.options.scrollperpage === true ? (base.options.items - 1) : 0)) { if (base.options.rewindnav === true) { base.currentitem = 0; speed = "rewind"; } else { base.currentitem = base.maximumitem; return false; } } base.goto(base.currentitem, speed); }, prev : function (speed) { var base = this; if (base.istransition) { return false; } if (base.options.scrollperpage === true && base.currentitem > 0 && base.currentitem < base.options.items) { base.currentitem = 0; } else { base.currentitem -= base.options.scrollperpage === true ? base.options.items : 1; } if (base.currentitem < 0) { if (base.options.rewindnav === true) { base.currentitem = base.maximumitem; speed = "rewind"; } else { base.currentitem = 0; return false; } } base.goto(base.currentitem, speed); }, goto : function (position, speed, drag) { var base = this, gotopixel; if (base.istransition) { return false; } if (typeof base.options.beforemove === "function") { base.options.beforemove.apply(this, [base.$elem]); } if (position >= base.maximumitem) { position = base.maximumitem; } else if (position <= 0) { position = 0; } base.currentitem = base.owl.currentitem = position; if (base.options.transitionstyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) { base.swapspeed(0); if (base.browser.support3d === true) { base.transition3d(base.positionsinarray[position]); } else { base.css2slide(base.positionsinarray[position], 1); } base.aftergo(); base.singleitemtransition(); return false; } gotopixel = base.positionsinarray[position]; if (base.browser.support3d === true) { base.iscss3finish = false; if (speed === true) { base.swapspeed("paginationspeed"); window.settimeout(function () { base.iscss3finish = true; }, base.options.paginationspeed); } else if (speed === "rewind") { base.swapspeed(base.options.rewindspeed); window.settimeout(function () { base.iscss3finish = true; }, base.options.rewindspeed); } else { base.swapspeed("slidespeed"); window.settimeout(function () { base.iscss3finish = true; }, base.options.slidespeed); } base.transition3d(gotopixel); } else { if (speed === true) { base.css2slide(gotopixel, base.options.paginationspeed); } else if (speed === "rewind") { base.css2slide(gotopixel, base.options.rewindspeed); } else { base.css2slide(gotopixel, base.options.slidespeed); } } base.aftergo(); }, jumpto : function (position) { var base = this; if (typeof base.options.beforemove === "function") { base.options.beforemove.apply(this, [base.$elem]); } if (position >= base.maximumitem || position === -1) { position = base.maximumitem; } else if (position <= 0) { position = 0; } base.swapspeed(0); if (base.browser.support3d === true) { base.transition3d(base.positionsinarray[position]); } else { base.css2slide(base.positionsinarray[position], 1); } base.currentitem = base.owl.currentitem = position; base.aftergo(); }, aftergo : function () { var base = this; base.prevarr.push(base.currentitem); base.previtem = base.owl.previtem = base.prevarr[base.prevarr.length - 2]; base.prevarr.shift(0); if (base.previtem !== base.currentitem) { base.checkpagination(); base.checknavigation(); base.eachmoveupdate(); if (base.options.autoplay !== false) { base.checkap(); } } if (typeof base.options.aftermove === "function" && base.previtem !== base.currentitem) { base.options.aftermove.apply(this, [base.$elem]); } }, stop : function () { var base = this; base.apstatus = "stop"; window.clearinterval(base.autoplayinterval); }, checkap : function () { var base = this; if (base.apstatus !== "stop") { base.play(); } }, play : function () { var base = this; base.apstatus = "play"; if (base.options.autoplay === false) { return false; } window.clearinterval(base.autoplayinterval); base.autoplayinterval = window.setinterval(function () { base.next(true); }, base.options.autoplay); }, swapspeed : function (action) { var base = this; if (action === "slidespeed") { base.$owlwrapper.css(base.addcssspeed(base.options.slidespeed)); } else if (action === "paginationspeed") { base.$owlwrapper.css(base.addcssspeed(base.options.paginationspeed)); } else if (typeof action !== "string") { base.$owlwrapper.css(base.addcssspeed(action)); } }, addcssspeed : function (speed) { return { "-webkit-transition": "all " + speed + "ms ease", "-moz-transition": "all " + speed + "ms ease", "-o-transition": "all " + speed + "ms ease", "transition": "all " + speed + "ms ease" }; }, removetransition : function () { return { "-webkit-transition": "", "-moz-transition": "", "-o-transition": "", "transition": "" }; }, dotranslate : function (pixels) { return { "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)", "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)", "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)", "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)", "transform": "translate3d(" + pixels + "px, 0px,0px)" }; }, transition3d : function (value) { var base = this; base.$owlwrapper.css(base.dotranslate(value)); }, css2move : function (value) { var base = this; base.$owlwrapper.css({"left" : value}); }, css2slide : function (value, speed) { var base = this; base.iscssfinish = false; base.$owlwrapper.stop(true, true).animate({ "left" : value }, { duration : speed || base.options.slidespeed, complete : function () { base.iscssfinish = true; } }); }, checkbrowser : function () { var base = this, translate3d = "translate3d(0px, 0px, 0px)", tempelem = document.createelement("div"), regex, assupport, support3d, istouch; tempelem.style.csstext = " -moz-transform:" + translate3d + "; -ms-transform:" + translate3d + "; -o-transform:" + translate3d + "; -webkit-transform:" + translate3d + "; transform:" + translate3d; regex = /translate3d\(0px, 0px, 0px\)/g; assupport = tempelem.style.csstext.match(regex); support3d = (assupport !== null && assupport.length === 1); istouch = "ontouchstart" in window || window.navigator.msmaxtouchpoints; base.browser = { "support3d" : support3d, "istouch" : istouch }; }, moveevents : function () { var base = this; if (base.options.mousedrag !== false || base.options.touchdrag !== false) { base.gestures(); base.disabledevents(); } }, eventtypes : function () { var base = this, types = ["s", "e", "x"]; base.ev_types = {}; if (base.options.mousedrag === true && base.options.touchdrag === true) { types = [ "touchstart.owl mousedown.owl", "touchmove.owl mousemove.owl", "touchend.owl touchcancel.owl mouseup.owl" ]; } else if (base.options.mousedrag === false && base.options.touchdrag === true) { types = [ "touchstart.owl", "touchmove.owl", "touchend.owl touchcancel.owl" ]; } else if (base.options.mousedrag === true && base.options.touchdrag === false) { types = [ "mousedown.owl", "mousemove.owl", "mouseup.owl" ]; } base.ev_types.start = types[0]; base.ev_types.move = types[1]; base.ev_types.end = types[2]; }, disabledevents : function () { var base = this; base.$elem.on("dragstart.owl", function (event) { event.preventdefault(); }); base.$elem.on("mousedown.disabletextselect", function (e) { return $(e.target).is('input, textarea, select, option'); }); }, gestures : function () { /*jslint unparam: true*/ var base = this, locals = { offsetx : 0, offsety : 0, baseelwidth : 0, relativepos : 0, position: null, minswipe : null, maxswipe: null, sliding : null, dargging: null, targetelement : null }; base.iscssfinish = true; function gettouches(event) { if (event.touches !== undefined) { return { x : event.touches[0].pagex, y : event.touches[0].pagey }; } if (event.touches === undefined) { if (event.pagex !== undefined) { return { x : event.pagex, y : event.pagey }; } if (event.pagex === undefined) { return { x : event.clientx, y : event.clienty }; } } } function swapevents(type) { if (type === "on") { $(document).on(base.ev_types.move, dragmove); $(document).on(base.ev_types.end, dragend); } else if (type === "off") { $(document).off(base.ev_types.move); $(document).off(base.ev_types.end); } } function dragstart(event) { var ev = event.originalevent || event || window.event, position; if (ev.which === 3) { return false; } if (base.itemsamount <= base.options.items) { return; } if (base.iscssfinish === false && !base.options.dragbeforeanimfinish) { return false; } if (base.iscss3finish === false && !base.options.dragbeforeanimfinish) { return false; } if (base.options.autoplay !== false) { window.clearinterval(base.autoplayinterval); } if (base.browser.istouch !== true && !base.$owlwrapper.hasclass("grabbing")) { base.$owlwrapper.addclass("grabbing"); } base.newposx = 0; base.newrelativex = 0; $(this).css(base.removetransition()); position = $(this).position(); locals.relativepos = position.left; locals.offsetx = gettouches(ev).x - position.left; locals.offsety = gettouches(ev).y - position.top; swapevents("on"); locals.sliding = false; locals.targetelement = ev.target || ev.srcelement; } function dragmove(event) { var ev = event.originalevent || event || window.event, minswipe, maxswipe; base.newposx = gettouches(ev).x - locals.offsetx; base.newposy = gettouches(ev).y - locals.offsety; base.newrelativex = base.newposx - locals.relativepos; if (typeof base.options.startdragging === "function" && locals.dragging !== true && base.newrelativex !== 0) { locals.dragging = true; base.options.startdragging.apply(base, [base.$elem]); } if ((base.newrelativex > 8 || base.newrelativex < -8) && (base.browser.istouch === true)) { if (ev.preventdefault !== undefined) { ev.preventdefault(); } else { ev.returnvalue = false; } locals.sliding = true; } if ((base.newposy > 10 || base.newposy < -10) && locals.sliding === false) { $(document).off("touchmove.owl"); } minswipe = function () { return base.newrelativex / 5; }; maxswipe = function () { return base.maximumpixels + base.newrelativex / 5; }; base.newposx = math.max(math.min(base.newposx, minswipe()), maxswipe()); if (base.browser.support3d === true) { base.transition3d(base.newposx); } else { base.css2move(base.newposx); } } function dragend(event) { var ev = event.originalevent || event || window.event, newposition, handlers, owlstopevent; ev.target = ev.target || ev.srcelement; locals.dragging = false; if (base.browser.istouch !== true) { base.$owlwrapper.removeclass("grabbing"); } if (base.newrelativex < 0) { base.dragdirection = base.owl.dragdirection = "left"; } else { base.dragdirection = base.owl.dragdirection = "right"; } if (base.newrelativex !== 0) { newposition = base.getnewposition(); base.goto(newposition, false, "drag"); if (locals.targetelement === ev.target && base.browser.istouch !== true) { $(ev.target).on("click.disable", function (ev) { ev.stopimmediatepropagation(); ev.stoppropagation(); ev.preventdefault(); $(ev.target).off("click.disable"); }); handlers = $._data(ev.target, "events").click; owlstopevent = handlers.pop(); handlers.splice(0, 0, owlstopevent); } } swapevents("off"); } base.$elem.on(base.ev_types.start, ".owl-wrapper", dragstart); }, getnewposition : function () { var base = this, newposition = base.closestitem(); if (newposition > base.maximumitem) { base.currentitem = base.maximumitem; newposition = base.maximumitem; } else if (base.newposx >= 0) { newposition = 0; base.currentitem = 0; } return newposition; }, closestitem : function () { var base = this, array = base.options.scrollperpage === true ? base.pagesinarray : base.positionsinarray, goal = base.newposx, closest = null; $.each(array, function (i, v) { if (goal - (base.itemwidth / 20) > array[i + 1] && goal - (base.itemwidth / 20) < v && base.movedirection() === "left") { closest = v; if (base.options.scrollperpage === true) { base.currentitem = $.inarray(closest, base.positionsinarray); } else { base.currentitem = i; } } else if (goal + (base.itemwidth / 20) < v && goal + (base.itemwidth / 20) > (array[i + 1] || array[i] - base.itemwidth) && base.movedirection() === "right") { if (base.options.scrollperpage === true) { closest = array[i + 1] || array[array.length - 1]; base.currentitem = $.inarray(closest, base.positionsinarray); } else { closest = array[i + 1]; base.currentitem = i + 1; } } }); return base.currentitem; }, movedirection : function () { var base = this, direction; if (base.newrelativex < 0) { direction = "right"; base.playdirection = "next"; } else { direction = "left"; base.playdirection = "prev"; } return direction; }, customevents : function () { /*jslint unparam: true*/ var base = this; base.$elem.on("owl.next", function () { base.next(); }); base.$elem.on("owl.prev", function () { base.prev(); }); base.$elem.on("owl.play", function (event, speed) { base.options.autoplay = speed; base.play(); base.hoverstatus = "play"; }); base.$elem.on("owl.stop", function () { base.stop(); base.hoverstatus = "stop"; }); base.$elem.on("owl.goto", function (event, item) { base.goto(item); }); base.$elem.on("owl.jumpto", function (event, item) { base.jumpto(item); }); }, stoponhover : function () { var base = this; if (base.options.stoponhover === true && base.browser.istouch !== true && base.options.autoplay !== false) { base.$elem.on("mouseover", function () { base.stop(); }); base.$elem.on("mouseout", function () { if (base.hoverstatus !== "stop") { base.play(); } }); } }, lazyload : function () { var base = this, i, $item, itemnumber, $lazyimg, follow; if (base.options.lazyload === false) { return false; } for (i = 0; i < base.itemsamount; i += 1) { $item = $(base.$owlitems[i]); if ($item.data("owl-loaded") === "loaded") { continue; } itemnumber = $item.data("owl-item"); $lazyimg = $item.find(".lazyowl"); if (typeof $lazyimg.data("src") !== "string") { $item.data("owl-loaded", "loaded"); continue; } if ($item.data("owl-loaded") === undefined) { $lazyimg.hide(); $item.addclass("loading").data("owl-loaded", "checked"); } if (base.options.lazyfollow === true) { follow = itemnumber >= base.currentitem; } else { follow = true; } if (follow && itemnumber < base.currentitem + base.options.items && $lazyimg.length) { base.lazypreload($item, $lazyimg); } } }, lazypreload : function ($item, $lazyimg) { var base = this, iterations = 0, isbackgroundimg; if ($lazyimg.prop("tagname") === "div") { $lazyimg.css("background-image", "url(" + $lazyimg.data("src") + ")"); isbackgroundimg = true; } else { $lazyimg[0].src = $lazyimg.data("src"); } function showimage() { $item.data("owl-loaded", "loaded").removeclass("loading"); $lazyimg.removeattr("data-src"); if (base.options.lazyeffect === "fade") { $lazyimg.fadein(400); } else { $lazyimg.show(); } if (typeof base.options.afterlazyload === "function") { base.options.afterlazyload.apply(this, [base.$elem]); } } function checklazyimage() { iterations += 1; if (base.completeimg($lazyimg.get(0)) || isbackgroundimg === true) { showimage(); } else if (iterations <= 100) {//if image loads in less than 10 seconds window.settimeout(checklazyimage, 100); } else { showimage(); } } checklazyimage(); }, autoheight : function () { var base = this, $currentimg = $(base.$owlitems[base.currentitem]).find("img"), iterations; function addheight() { var $currentitem = $(base.$owlitems[base.currentitem]).height(); base.wrapperouter.css("height", $currentitem + "px"); if (!base.wrapperouter.hasclass("autoheight")) { window.settimeout(function () { base.wrapperouter.addclass("autoheight"); }, 0); } } function checkimage() { iterations += 1; if (base.completeimg($currentimg.get(0))) { addheight(); } else if (iterations <= 100) { //if image loads in less than 10 seconds window.settimeout(checkimage, 100); } else { base.wrapperouter.css("height", ""); //else remove height attribute } } if ($currentimg.get(0) !== undefined) { iterations = 0; checkimage(); } else { addheight(); } }, completeimg : function (img) { var naturalwidthtype; if (!img.complete) { return false; } naturalwidthtype = typeof img.naturalwidth; if (naturalwidthtype !== "undefined" && img.naturalwidth === 0) { return false; } return true; }, onvisibleitems : function () { var base = this, i; if (base.options.addclassactive === true) { base.$owlitems.removeclass("active"); } base.visibleitems = []; for (i = base.currentitem; i < base.currentitem + base.options.items; i += 1) { base.visibleitems.push(i); if (base.options.addclassactive === true) { $(base.$owlitems[i]).addclass("active"); } } base.owl.visibleitems = base.visibleitems; }, transitiontypes : function (classname) { var base = this; //currently available: "fade", "backslide", "godown", "fadeup" base.outclass = "owl-" + classname + "-out"; base.inclass = "owl-" + classname + "-in"; }, singleitemtransition : function () { var base = this, outclass = base.outclass, inclass = base.inclass, $currentitem = base.$owlitems.eq(base.currentitem), $previtem = base.$owlitems.eq(base.previtem), prevpos = math.abs(base.positionsinarray[base.currentitem]) + base.positionsinarray[base.previtem], origin = math.abs(base.positionsinarray[base.currentitem]) + base.itemwidth / 2, animend = 'webkitanimationend oanimationend msanimationend animationend'; base.istransition = true; base.$owlwrapper .addclass('owl-origin') .css({ "-webkit-transform-origin" : origin + "px", "-moz-perspective-origin" : origin + "px", "perspective-origin" : origin + "px" }); function transstyles(prevpos) { return { "position" : "relative", "left" : prevpos + "px" }; } $previtem .css(transstyles(prevpos, 10)) .addclass(outclass) .on(animend, function () { base.endprev = true; $previtem.off(animend); base.cleartransstyle($previtem, outclass); }); $currentitem .addclass(inclass) .on(animend, function () { base.endcurrent = true; $currentitem.off(animend); base.cleartransstyle($currentitem, inclass); }); }, cleartransstyle : function (item, classtoremove) { var base = this; item.css({ "position" : "", "left" : "" }).removeclass(classtoremove); if (base.endprev && base.endcurrent) { base.$owlwrapper.removeclass('owl-origin'); base.endprev = false; base.endcurrent = false; base.istransition = false; } }, owlstatus : function () { var base = this; base.owl = { "useroptions" : base.useroptions, "baseelement" : base.$elem, "useritems" : base.$useritems, "owlitems" : base.$owlitems, "currentitem" : base.currentitem, "previtem" : base.previtem, "visibleitems" : base.visibleitems, "istouch" : base.browser.istouch, "browser" : base.browser, "dragdirection" : base.dragdirection }; }, clearevents : function () { var base = this; base.$elem.off(".owl owl mousedown.disabletextselect"); $(document).off(".owl owl"); $(window).off("resize", base.resizer); }, unwrap : function () { var base = this; if (base.$elem.children().length !== 0) { base.$owlwrapper.unwrap(); base.$useritems.unwrap().unwrap(); if (base.owlcontrols) { base.owlcontrols.remove(); } } base.clearevents(); base.$elem .attr("style", base.$elem.data("owl-originalstyles") || "") .attr("class", base.$elem.data("owl-originalclasses")); }, destroy : function () { var base = this; base.stop(); window.clearinterval(base.checkvisible); base.unwrap(); base.$elem.removedata(); }, reinit : function (newoptions) { var base = this, options = $.extend({}, base.useroptions, newoptions); base.unwrap(); base.init(options, base.$elem); }, additem : function (htmlstring, targetposition) { var base = this, position; if (!htmlstring) {return false; } if (base.$elem.children().length === 0) { base.$elem.append(htmlstring); base.setvars(); return false; } base.unwrap(); if (targetposition === undefined || targetposition === -1) { position = -1; } else { position = targetposition; } if (position >= base.$useritems.length || position === -1) { base.$useritems.eq(-1).after(htmlstring); } else { base.$useritems.eq(position).before(htmlstring); } base.setvars(); }, removeitem : function (targetposition) { var base = this, position; if (base.$elem.children().length === 0) { return false; } if (targetposition === undefined || targetposition === -1) { position = -1; } else { position = targetposition; } base.unwrap(); base.$useritems.eq(position).remove(); base.setvars(); } }; $.fn.owlcarousel = function (options) { return this.each(function () { if ($(this).data("owl-init") === true) { return false; } $(this).data("owl-init", true); var carousel = object.create(carousel); carousel.init(options, this); $.data(this, "owlcarousel", carousel); }); }; $.fn.owlcarousel.options = { items : 5, itemscustom : false, itemsdesktop : [1199, 4], itemsdesktopsmall : [1024, 3], itemstablet : [860, 2], itemstabletsmall : false, itemsmobile : [480, 1], singleitem : false, itemsscaleup : false, slidespeed : 200, paginationspeed : 800, rewindspeed : 1000, autoplay : false, stoponhover : false, navigation : false, navigationtext : ["prev", "next"], rewindnav : true, scrollperpage : false, pagination : true, paginationnumbers : false, responsive : true, responsiverefreshrate : 200, responsivebasewidth : window, baseclass : "owl-carousel", theme : "owl-theme", lazyload : false, lazyfollow : true, lazyeffect : "fade", autoheight : false, jsonpath : false, jsonsuccess : false, dragbeforeanimfinish : true, mousedrag : true, touchdrag : true, addclassactive : false, transitionstyle : false, beforeupdate : false, afterupdate : false, beforeinit : false, afterinit : false, beforemove : false, aftermove : false, afteraction : false, startdragging : false, afterlazyload: false }; }(jquery, window, document)); $(function(){ if(!placeholdersupport()){ // 判断浏览器是否支持 placeholder $('[placeholder]').focus(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); input.removeclass('placeholder'); } }).blur(function() { var input = $(this); if (input.val() == '' || input.val() == input.attr('placeholder')) { input.addclass('placeholder'); input.val(input.attr('placeholder')); } }).blur(); }; }) function placeholdersupport() { return 'placeholder' in document.createelement('input'); }; /* video */ var cyplayer={load:function(objs){var objplay=jwplayer(objs.vcontainer).setup({flashplayer:'js/video/flashplay.swf', html5player:'js/video/html5player.js',file:objs.vfiles,image:objs.vfimg,width:'100%',height:'100%',aspectratio:'16:9',stretching:'fill',controls:'true',repeat:objs.repeat,transition:'random',volume:47,autostart:objs.isautoplay});return objplay;}}