/*! 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;a', 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: 100 }; _.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 = ''; _.$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 _; }; })); /*slick end*/ (function(root, factory) { if (typeof define === 'function' && define.amd) { define(factory); } else if (typeof exports === 'object') { module.exports = factory(require, exports, module); } else { root.countup = factory(); } }(this, function(require, exports, module) { /* countup.js (c) 2014-2015 @inorganik licensed under the mit license. */ // target = id of html element or var of previously selected html element where counting occurs // startval = the value you want to begin at // endval = the value you want to arrive at // decimals = number of decimal places, default 0 // duration = duration of animation in seconds, default 2 // options = optional object of options (see below) var countup = function(target, startval, endval, decimals, duration, options) { // make sure requestanimationframe and cancelanimationframe are defined // polyfill for browsers without native support // by opera engineer erik möller var lasttime = 0; var vendors = ['webkit', 'moz', 'ms', 'o']; for(var x = 0; x < vendors.length && !window.requestanimationframe; ++x) { window.requestanimationframe = window[vendors[x]+'requestanimationframe']; window.cancelanimationframe = window[vendors[x]+'cancelanimationframe'] || window[vendors[x]+'cancelrequestanimationframe']; } if (!window.requestanimationframe) { window.requestanimationframe = function(callback, element) { var currtime = new date().gettime(); var timetocall = math.max(0, 16 - (currtime - lasttime)); var id = window.settimeout(function() { callback(currtime + timetocall); }, timetocall); lasttime = currtime + timetocall; return id; }; } if (!window.cancelanimationframe) { window.cancelanimationframe = function(id) { cleartimeout(id); }; } // default options this.options = { useeasing : true, // toggle easing usegrouping : true, // 1,000,000 vs 1000000 separator : ',', // character to use as a separator decimal : '.' // character to use as a decimal }; // extend default options with passed options object for (var key in options) { if (options.hasownproperty(key)) { this.options[key] = options[key]; } } if (this.options.separator === '') this.options.usegrouping = false; if (!this.options.prefix) this.options.prefix = ''; if (!this.options.suffix) this.options.suffix = ''; this.d = (typeof target === 'string') ? document.getelementbyid(target) : target; this.startval = number(startval); this.endval = number(endval); this.countdown = (this.startval > this.endval); this.frameval = this.startval; this.decimals = math.max(0, decimals || 0); this.dec = math.pow(10, this.decimals); this.duration = number(duration) * 1000 || 2000; var self = this; this.version = function () { return '1.6.0'; }; // print value to target this.printvalue = function(value) { var result = (!isnan(value)) ? self.formatnumber(value) : '--'; if (self.d.tagname == 'input') { this.d.value = result; } else if (self.d.tagname == 'text' || self.d.tagname == 'tspan') { this.d.textcontent = result; } else { this.d.innerhtml = result; } }; // robert penner's easeoutexpo this.easeoutexpo = function(t, b, c, d) { return c * (-math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b; }; this.count = function(timestamp) { if (!self.starttime) self.starttime = timestamp; self.timestamp = timestamp; var progress = timestamp - self.starttime; self.remaining = self.duration - progress; // to ease or not to ease if (self.options.useeasing) { if (self.countdown) { self.frameval = self.startval - self.easeoutexpo(progress, 0, self.startval - self.endval, self.duration); } else { self.frameval = self.easeoutexpo(progress, self.startval, self.endval - self.startval, self.duration); } } else { if (self.countdown) { self.frameval = self.startval - ((self.startval - self.endval) * (progress / self.duration)); } else { self.frameval = self.startval + (self.endval - self.startval) * (progress / self.duration); } } // don't go past endval since progress can exceed duration in the last frame if (self.countdown) { self.frameval = (self.frameval < self.endval) ? self.endval : self.frameval; } else { self.frameval = (self.frameval > self.endval) ? self.endval : self.frameval; } // decimal self.frameval = math.round(self.frameval*self.dec)/self.dec; // format and print value self.printvalue(self.frameval); // whether to continue if (progress < self.duration) { self.raf = requestanimationframe(self.count); } else { if (self.callback) self.callback(); } }; // start your animation this.start = function(callback) { self.callback = callback; self.raf = requestanimationframe(self.count); return false; }; // toggles pause/resume animation this.pauseresume = function() { if (!self.paused) { self.paused = true; cancelanimationframe(self.raf); } else { self.paused = false; delete self.starttime; self.duration = self.remaining; self.startval = self.frameval; requestanimationframe(self.count); } }; // reset to startval so animation can be run again this.reset = function() { self.paused = false; delete self.starttime; self.startval = startval; cancelanimationframe(self.raf); self.printvalue(self.startval); }; // pass a new endval and start animation this.update = function (newendval) { cancelanimationframe(self.raf); self.paused = false; delete self.starttime; self.startval = self.frameval; self.endval = number(newendval); self.countdown = (self.startval > self.endval); self.raf = requestanimationframe(self.count); }; this.formatnumber = function(nstr) { nstr = nstr.tofixed(self.decimals); nstr += ''; var x, x1, x2, rgx; x = nstr.split('.'); x1 = x[0]; x2 = x.length > 1 ? self.options.decimal + x[1] : ''; rgx = /(\d+)(\d{3})/; if (self.options.usegrouping) { while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + self.options.separator + '$2'); } } return self.options.prefix + x1 + x2 + self.options.suffix; }; // format startval on initialization self.printvalue(self.startval); }; // example: // var numanim = new countup("someelementyouwanttoanimate", 0, 99.99, 2, 2.5); // numanim.start(); // numanim.update(135); // with optional callback: // numanim.start(somemethodtocalloncomplete); return countup; })); /* * jquery flexslider v2.6.3 * copyright 2012 woothemes * contributing author: tyler smith */ ; (function ($) { var focused = true; //flexslider: object instance $.flexslider = function(el, options) { var slider = $(el); // making variables public slider.vars = $.extend({}, $.flexslider.defaults, options); var namespace = slider.vars.namespace, msgesture = window.navigator && window.navigator.mspointerenabled && window.msgesture, touch = (( "ontouchstart" in window ) || msgesture || window.documenttouch && document instanceof documenttouch) && slider.vars.touch, // depricating this idea, as devices are being released with both of these events eventtype = "click touchend mspointerup keyup", watchedevent = "", watchedeventcleartimer, vertical = slider.vars.direction === "vertical", reverse = slider.vars.reverse, carousel = (slider.vars.itemwidth > 0), fade = slider.vars.animation === "fade", asnav = slider.vars.asnavfor !== "", methods = {}; // store a reference to the slider object $.data(el, "flexslider", slider); // private slider methods methods = { init: function() { slider.animating = false; // get current slide and make sure it is a number slider.currentslide = parseint( ( slider.vars.startat ? slider.vars.startat : 0), 10 ); if ( isnan( slider.currentslide ) ) { slider.currentslide = 0; } slider.animatingto = slider.currentslide; slider.atend = (slider.currentslide === 0 || slider.currentslide === slider.last); slider.containerselector = slider.vars.selector.substr(0,slider.vars.selector.search(' ')); slider.slides = $(slider.vars.selector, slider); slider.container = $(slider.containerselector, slider); slider.count = slider.slides.length; // sync: slider.syncexists = $(slider.vars.sync).length > 0; // slide: if (slider.vars.animation === "slide") { slider.vars.animation = "swing"; } slider.prop = (vertical) ? "top" : "marginleft"; slider.args = {}; // slideshow: slider.manualpause = false; slider.stopped = false; //pause when invisible slider.started = false; slider.starttimeout = null; // touch/usecss: slider.transitions = !slider.vars.video && !fade && slider.vars.usecss && (function() { var obj = document.createelement('div'), props = ['perspectiveproperty', 'webkitperspective', 'mozperspective', 'operspective', 'msperspective']; for (var i in props) { if ( obj.style[ props[i] ] !== undefined ) { slider.pfx = props[i].replace('perspective','').tolowercase(); slider.prop = "-" + slider.pfx + "-transform"; return true; } } return false; }()); slider.ensureanimationend = ''; // controlscontainer: if (slider.vars.controlscontainer !== "") slider.controlscontainer = $(slider.vars.controlscontainer).length > 0 && $(slider.vars.controlscontainer); // manual: if (slider.vars.manualcontrols !== "") slider.manualcontrols = $(slider.vars.manualcontrols).length > 0 && $(slider.vars.manualcontrols); // custom direction nav: if (slider.vars.customdirectionnav !== "") slider.customdirectionnav = $(slider.vars.customdirectionnav).length === 2 && $(slider.vars.customdirectionnav); // randomize: if (slider.vars.randomize) { slider.slides.sort(function() { return (math.round(math.random())-0.5); }); slider.container.empty().append(slider.slides); } slider.domath(); // init slider.setup("init"); // controlnav: if (slider.vars.controlnav) { methods.controlnav.setup(); } // directionnav: if (slider.vars.directionnav) { methods.directionnav.setup(); } // keyboard: if (slider.vars.keyboard && ($(slider.containerselector).length === 1 || slider.vars.multiplekeyboard)) { $(document).bind('keyup', function(event) { var keycode = event.keycode; if (!slider.animating && (keycode === 39 || keycode === 37)) { var target = (keycode === 39) ? slider.gettarget('next') : (keycode === 37) ? slider.gettarget('prev') : false; slider.flexanimate(target, slider.vars.pauseonaction); } }); } // mousewheel: if (slider.vars.mousewheel) { slider.bind('mousewheel', function(event, delta, deltax, deltay) { event.preventdefault(); var target = (delta < 0) ? slider.gettarget('next') : slider.gettarget('prev'); slider.flexanimate(target, slider.vars.pauseonaction); }); } // pauseplay if (slider.vars.pauseplay) { methods.pauseplay.setup(); } //pause when invisible if (slider.vars.slideshow && slider.vars.pauseinvisible) { methods.pauseinvisible.init(); } // slidseshow if (slider.vars.slideshow) { if (slider.vars.pauseonhover) { slider.hover(function() { if (!slider.manualplay && !slider.manualpause) { slider.pause(); } }, function() { if (!slider.manualpause && !slider.manualplay && !slider.stopped) { slider.play(); } }); } // initialize animation //if we're visible, or we don't use pagevisibility api if(!slider.vars.pauseinvisible || !methods.pauseinvisible.ishidden()) { (slider.vars.initdelay > 0) ? slider.starttimeout = settimeout(slider.play, slider.vars.initdelay) : slider.play(); } } // asnav: if (asnav) { methods.asnav.setup(); } // touch if (touch && slider.vars.touch) { methods.touch(); } // fade&&smoothheight || slide: if (!fade || (fade && slider.vars.smoothheight)) { $(window).bind("resize orientationchange focus", methods.resize); } slider.find("img").attr("draggable", "false"); // api: start() callback settimeout(function(){ slider.vars.start(slider); }, 200); }, asnav: { setup: function() { slider.asnav = true; slider.animatingto = math.floor(slider.currentslide/slider.move); slider.currentitem = slider.currentslide; slider.slides.removeclass(namespace + "active-slide").eq(slider.currentitem).addclass(namespace + "active-slide"); if(!msgesture){ slider.slides.on(eventtype, function(e){ e.preventdefault(); var $slide = $(this), target = $slide.index(); var posfromleft = $slide.offset().left - $(slider).scrollleft(); // find position of slide relative to left of slider container if( posfromleft <= 0 && $slide.hasclass( namespace + 'active-slide' ) ) { slider.flexanimate(slider.gettarget("prev"), true); } else if (!$(slider.vars.asnavfor).data('flexslider').animating && !$slide.hasclass(namespace + "active-slide")) { slider.direction = (slider.currentitem < target) ? "next" : "prev"; slider.flexanimate(target, slider.vars.pauseonaction, false, true, true); } }); }else{ el._slider = slider; slider.slides.each(function (){ var that = this; that._gesture = new msgesture(); that._gesture.target = that; that.addeventlistener("mspointerdown", function (e){ e.preventdefault(); if(e.currenttarget._gesture) { e.currenttarget._gesture.addpointer(e.pointerid); } }, false); that.addeventlistener("msgesturetap", function (e){ e.preventdefault(); var $slide = $(this), target = $slide.index(); if (!$(slider.vars.asnavfor).data('flexslider').animating && !$slide.hasclass('active')) { slider.direction = (slider.currentitem < target) ? "next" : "prev"; slider.flexanimate(target, slider.vars.pauseonaction, false, true, true); } }); }); } } }, controlnav: { setup: function() { if (!slider.manualcontrols) { methods.controlnav.setuppaging(); } else { // manualcontrols: methods.controlnav.setupmanual(); } }, setuppaging: function() { var type = (slider.vars.controlnav === "thumbnails") ? 'control-thumbs' : 'control-paging', j = 1, item, slide; slider.controlnavscaffold = $('
      '); if (slider.pagingcount > 1) { for (var i = 0; i < slider.pagingcount; i++) { slide = slider.slides.eq(i); if ( undefined === slide.attr( 'data-thumb-alt' ) ) { slide.attr( 'data-thumb-alt', '' ); } var alttext = ( '' !== slide.attr( 'data-thumb-alt' ) ) ? alttext = ' alt="' + slide.attr( 'data-thumb-alt' ) + '"' : ''; item = (slider.vars.controlnav === "thumbnails") ? '' : '' + j + ''; if ( 'thumbnails' === slider.vars.controlnav && true === slider.vars.thumbcaptions ) { var captn = slide.attr( 'data-thumbcaption' ); if ( '' !== captn && undefined !== captn ) { item += '' + captn + ''; } } slider.controlnavscaffold.append('
    1. ' + item + '
    2. '); j++; } } // controlscontainer: (slider.controlscontainer) ? $(slider.controlscontainer).append(slider.controlnavscaffold) : slider.append(slider.controlnavscaffold); methods.controlnav.set(); methods.controlnav.active(); slider.controlnavscaffold.delegate('a, img', eventtype, function(event) { event.preventdefault(); if (watchedevent === "" || watchedevent === event.type) { var $this = $(this), target = slider.controlnav.index($this); if (!$this.hasclass(namespace + 'active')) { slider.direction = (target > slider.currentslide) ? "next" : "prev"; slider.flexanimate(target, slider.vars.pauseonaction); } } // setup flags to prevent event duplication if (watchedevent === "") { watchedevent = event.type; } methods.settoclearwatchedevent(); }); }, setupmanual: function() { slider.controlnav = slider.manualcontrols; methods.controlnav.active(); slider.controlnav.bind(eventtype, function(event) { event.preventdefault(); if (watchedevent === "" || watchedevent === event.type) { var $this = $(this), target = slider.controlnav.index($this); if (!$this.hasclass(namespace + 'active')) { (target > slider.currentslide) ? slider.direction = "next" : slider.direction = "prev"; slider.flexanimate(target, slider.vars.pauseonaction); } } // setup flags to prevent event duplication if (watchedevent === "") { watchedevent = event.type; } methods.settoclearwatchedevent(); }); }, set: function() { var selector = (slider.vars.controlnav === "thumbnails") ? 'img' : 'a'; slider.controlnav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlscontainer) ? slider.controlscontainer : slider); }, active: function() { slider.controlnav.removeclass(namespace + "active").eq(slider.animatingto).addclass(namespace + "active"); }, update: function(action, pos) { if (slider.pagingcount > 1 && action === "add") { slider.controlnavscaffold.append($('
    3. ' + slider.count + '
    4. ')); } else if (slider.pagingcount === 1) { slider.controlnavscaffold.find('li').remove(); } else { slider.controlnav.eq(pos).closest('li').remove(); } methods.controlnav.set(); (slider.pagingcount > 1 && slider.pagingcount !== slider.controlnav.length) ? slider.update(pos, action) : methods.controlnav.active(); } }, directionnav: { setup: function() { var directionnavscaffold = $(''); // custom direction nav: if (slider.customdirectionnav) { slider.directionnav = slider.customdirectionnav; // controlscontainer: } else if (slider.controlscontainer) { $(slider.controlscontainer).append(directionnavscaffold); slider.directionnav = $('.' + namespace + 'direction-nav li a', slider.controlscontainer); } else { slider.append(directionnavscaffold); slider.directionnav = $('.' + namespace + 'direction-nav li a', slider); } methods.directionnav.update(); slider.directionnav.bind(eventtype, function(event) { event.preventdefault(); var target; if (watchedevent === "" || watchedevent === event.type) { target = ($(this).hasclass(namespace + 'next')) ? slider.gettarget('next') : slider.gettarget('prev'); slider.flexanimate(target, slider.vars.pauseonaction); } // setup flags to prevent event duplication if (watchedevent === "") { watchedevent = event.type; } methods.settoclearwatchedevent(); }); }, update: function() { var disabledclass = namespace + 'disabled'; if (slider.pagingcount === 1) { slider.directionnav.addclass(disabledclass).attr('tabindex', '-1'); } else if (!slider.vars.animationloop) { if (slider.animatingto === 0) { slider.directionnav.removeclass(disabledclass).filter('.' + namespace + "prev").addclass(disabledclass).attr('tabindex', '-1'); } else if (slider.animatingto === slider.last) { slider.directionnav.removeclass(disabledclass).filter('.' + namespace + "next").addclass(disabledclass).attr('tabindex', '-1'); } else { slider.directionnav.removeclass(disabledclass).removeattr('tabindex'); } } else { slider.directionnav.removeclass(disabledclass).removeattr('tabindex'); } } }, pauseplay: { setup: function() { var pauseplayscaffold = $('
      '); // controlscontainer: if (slider.controlscontainer) { slider.controlscontainer.append(pauseplayscaffold); slider.pauseplay = $('.' + namespace + 'pauseplay a', slider.controlscontainer); } else { slider.append(pauseplayscaffold); slider.pauseplay = $('.' + namespace + 'pauseplay a', slider); } methods.pauseplay.update((slider.vars.slideshow) ? namespace + 'pause' : namespace + 'play'); slider.pauseplay.bind(eventtype, function(event) { event.preventdefault(); if (watchedevent === "" || watchedevent === event.type) { if ($(this).hasclass(namespace + 'pause')) { slider.manualpause = true; slider.manualplay = false; slider.pause(); } else { slider.manualpause = false; slider.manualplay = true; slider.play(); } } // setup flags to prevent event duplication if (watchedevent === "") { watchedevent = event.type; } methods.settoclearwatchedevent(); }); }, update: function(state) { (state === "play") ? slider.pauseplay.removeclass(namespace + 'pause').addclass(namespace + 'play').html(slider.vars.playtext) : slider.pauseplay.removeclass(namespace + 'play').addclass(namespace + 'pause').html(slider.vars.pausetext); } }, touch: function() { var startx, starty, offset, cwidth, dx, startt, ontouchstart, ontouchmove, ontouchend, scrolling = false, localx = 0, localy = 0, accdx = 0; if(!msgesture){ ontouchstart = function(e) { if (slider.animating) { e.preventdefault(); } else if ( ( window.navigator.mspointerenabled ) || e.touches.length === 1 ) { slider.pause(); // carousel: cwidth = (vertical) ? slider.h : slider. w; startt = number(new date()); // carousel: // local vars for x and y points. localx = e.touches[0].pagex; localy = e.touches[0].pagey; offset = (carousel && reverse && slider.animatingto === slider.last) ? 0 : (carousel && reverse) ? slider.limit - (((slider.itemw + slider.vars.itemmargin) * slider.move) * slider.animatingto) : (carousel && slider.currentslide === slider.last) ? slider.limit : (carousel) ? ((slider.itemw + slider.vars.itemmargin) * slider.move) * slider.currentslide : (reverse) ? (slider.last - slider.currentslide + slider.cloneoffset) * cwidth : (slider.currentslide + slider.cloneoffset) * cwidth; startx = (vertical) ? localy : localx; starty = (vertical) ? localx : localy; el.addeventlistener('touchmove', ontouchmove, false); el.addeventlistener('touchend', ontouchend, false); } }; ontouchmove = function(e) { // local vars for x and y points. localx = e.touches[0].pagex; localy = e.touches[0].pagey; dx = (vertical) ? startx - localy : startx - localx; scrolling = (vertical) ? (math.abs(dx) < math.abs(localx - starty)) : (math.abs(dx) < math.abs(localy - starty)); var fxms = 500; if ( ! scrolling || number( new date() ) - startt > fxms ) { e.preventdefault(); if (!fade && slider.transitions) { if (!slider.vars.animationloop) { dx = dx/((slider.currentslide === 0 && dx < 0 || slider.currentslide === slider.last && dx > 0) ? (math.abs(dx)/cwidth+2) : 1); } slider.setprops(offset + dx, "settouch"); } } }; ontouchend = function(e) { // finish the touch by undoing the touch session el.removeeventlistener('touchmove', ontouchmove, false); if (slider.animatingto === slider.currentslide && !scrolling && !(dx === null)) { var updatedx = (reverse) ? -dx : dx, target = (updatedx > 0) ? slider.gettarget('next') : slider.gettarget('prev'); if (slider.canadvance(target) && (number(new date()) - startt < 550 && math.abs(updatedx) > 50 || math.abs(updatedx) > cwidth/2)) { slider.flexanimate(target, slider.vars.pauseonaction); } else { if (!fade) { slider.flexanimate(slider.currentslide, slider.vars.pauseonaction, true); } } } el.removeeventlistener('touchend', ontouchend, false); startx = null; starty = null; dx = null; offset = null; }; el.addeventlistener('touchstart', ontouchstart, false); }else{ el.style.mstouchaction = "none"; el._gesture = new msgesture(); el._gesture.target = el; el.addeventlistener("mspointerdown", onmspointerdown, false); el._slider = slider; el.addeventlistener("msgesturechange", onmsgesturechange, false); el.addeventlistener("msgestureend", onmsgestureend, false); function onmspointerdown(e){ e.stoppropagation(); if (slider.animating) { e.preventdefault(); }else{ slider.pause(); el._gesture.addpointer(e.pointerid); accdx = 0; cwidth = (vertical) ? slider.h : slider. w; startt = number(new date()); // carousel: offset = (carousel && reverse && slider.animatingto === slider.last) ? 0 : (carousel && reverse) ? slider.limit - (((slider.itemw + slider.vars.itemmargin) * slider.move) * slider.animatingto) : (carousel && slider.currentslide === slider.last) ? slider.limit : (carousel) ? ((slider.itemw + slider.vars.itemmargin) * slider.move) * slider.currentslide : (reverse) ? (slider.last - slider.currentslide + slider.cloneoffset) * cwidth : (slider.currentslide + slider.cloneoffset) * cwidth; } } function onmsgesturechange(e) { e.stoppropagation(); var slider = e.target._slider; if(!slider){ return; } var transx = -e.translationx, transy = -e.translationy; //accumulate translations. accdx = accdx + ((vertical) ? transy : transx); dx = accdx; scrolling = (vertical) ? (math.abs(accdx) < math.abs(-transx)) : (math.abs(accdx) < math.abs(-transy)); if(e.detail === e.msgesture_flag_inertia){ setimmediate(function (){ el._gesture.stop(); }); return; } if (!scrolling || number(new date()) - startt > 500) { e.preventdefault(); if (!fade && slider.transitions) { if (!slider.vars.animationloop) { dx = accdx / ((slider.currentslide === 0 && accdx < 0 || slider.currentslide === slider.last && accdx > 0) ? (math.abs(accdx) / cwidth + 2) : 1); } slider.setprops(offset + dx, "settouch"); } } } function onmsgestureend(e) { e.stoppropagation(); var slider = e.target._slider; if(!slider){ return; } if (slider.animatingto === slider.currentslide && !scrolling && !(dx === null)) { var updatedx = (reverse) ? -dx : dx, target = (updatedx > 0) ? slider.gettarget('next') : slider.gettarget('prev'); if (slider.canadvance(target) && (number(new date()) - startt < 550 && math.abs(updatedx) > 50 || math.abs(updatedx) > cwidth/2)) { slider.flexanimate(target, slider.vars.pauseonaction); } else { if (!fade) { slider.flexanimate(slider.currentslide, slider.vars.pauseonaction, true); } } } startx = null; starty = null; dx = null; offset = null; accdx = 0; } } }, resize: function() { if (!slider.animating && slider.is(':visible')) { if (!carousel) { slider.domath(); } if (fade) { // smooth height: methods.smoothheight(); } else if (carousel) { //carousel: slider.slides.width(slider.computedw); slider.update(slider.pagingcount); slider.setprops(); } else if (vertical) { //vertical: slider.viewport.height(slider.h); slider.setprops(slider.h, "settotal"); } else { // smooth height: if (slider.vars.smoothheight) { methods.smoothheight(); } slider.newslides.width(slider.computedw); slider.setprops(slider.computedw, "settotal"); } } }, smoothheight: function(dur) { if (!vertical || fade) { var $obj = (fade) ? slider : slider.viewport; (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingto).innerheight()}, dur) : $obj.innerheight(slider.slides.eq(slider.animatingto).innerheight()); } }, sync: function(action) { var $obj = $(slider.vars.sync).data("flexslider"), target = slider.animatingto; switch (action) { case "animate": $obj.flexanimate(target, slider.vars.pauseonaction, false, true); break; case "play": if (!$obj.playing && !$obj.asnav) { $obj.play(); } break; case "pause": $obj.pause(); break; } }, uniqueid: function($clone) { // append _clone to current level and children elements with id attributes $clone.filter( '[id]' ).add($clone.find( '[id]' )).each(function() { var $this = $(this); $this.attr( 'id', $this.attr( 'id' ) + '_clone' ); }); return $clone; }, pauseinvisible: { visprop: null, init: function() { var visprop = methods.pauseinvisible.gethiddenprop(); if (visprop) { var evtname = visprop.replace(/[h|h]idden/,'') + 'visibilitychange'; document.addeventlistener(evtname, function() { if (methods.pauseinvisible.ishidden()) { if(slider.starttimeout) { cleartimeout(slider.starttimeout); //if clock is ticking, stop timer and prevent from starting while invisible } else { slider.pause(); //or just pause } } else { if(slider.started) { slider.play(); //initiated before, just play } else { if (slider.vars.initdelay > 0) { settimeout(slider.play, slider.vars.initdelay); } else { slider.play(); //didn't init before: simply init or wait for it } } } }); } }, ishidden: function() { var prop = methods.pauseinvisible.gethiddenprop(); if (!prop) { return false; } return document[prop]; }, gethiddenprop: function() { var prefixes = ['webkit','moz','ms','o']; // if 'hidden' is natively supported just return it if ('hidden' in document) { return 'hidden'; } // otherwise loop over all the known prefixes until we find one for ( var i = 0; i < prefixes.length; i++ ) { if ((prefixes[i] + 'hidden') in document) { return prefixes[i] + 'hidden'; } } // otherwise it's not supported return null; } }, settoclearwatchedevent: function() { cleartimeout(watchedeventcleartimer); watchedeventcleartimer = settimeout(function() { watchedevent = ""; }, 3000); } }; // public methods slider.flexanimate = function(target, pause, override, withsync, fromnav) { if (!slider.vars.animationloop && target !== slider.currentslide) { slider.direction = (target > slider.currentslide) ? "next" : "prev"; } if (asnav && slider.pagingcount === 1) slider.direction = (slider.currentitem < target) ? "next" : "prev"; if (!slider.animating && (slider.canadvance(target, fromnav) || override) && slider.is(":visible")) { if (asnav && withsync) { var master = $(slider.vars.asnavfor).data('flexslider'); slider.atend = target === 0 || target === slider.count - 1; master.flexanimate(target, true, false, true, fromnav); slider.direction = (slider.currentitem < target) ? "next" : "prev"; master.direction = slider.direction; if (math.ceil((target + 1)/slider.visible) - 1 !== slider.currentslide && target !== 0) { slider.currentitem = target; slider.slides.removeclass(namespace + "active-slide").eq(target).addclass(namespace + "active-slide"); target = math.floor(target/slider.visible); } else { slider.currentitem = target; slider.slides.removeclass(namespace + "active-slide").eq(target).addclass(namespace + "active-slide"); return false; } } slider.animating = true; slider.animatingto = target; // slideshow: if (pause) { slider.pause(); } // api: before() animation callback slider.vars.before(slider); // sync: if (slider.syncexists && !fromnav) { methods.sync("animate"); } // controlnav if (slider.vars.controlnav) { methods.controlnav.active(); } // !carousel: // candidate: slide active class (for add/remove slide) if (!carousel) { slider.slides.removeclass(namespace + 'active-slide').eq(target).addclass(namespace + 'active-slide'); } // infinite loop: // candidate: atend slider.atend = target === 0 || target === slider.last; // directionnav: if (slider.vars.directionnav) { methods.directionnav.update(); } if (target === slider.last) { // api: end() of cycle callback slider.vars.end(slider); // slideshow && !infinite loop: if (!slider.vars.animationloop) { slider.pause(); } } // slide: if (!fade) { var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedw, margin, slidestring, calcnext; // infinite loop / reverse: if (carousel) { margin = slider.vars.itemmargin; calcnext = ((slider.itemw + margin) * slider.move) * slider.animatingto; slidestring = (calcnext > slider.limit && slider.visible !== 1) ? slider.limit : calcnext; } else if (slider.currentslide === 0 && target === slider.count - 1 && slider.vars.animationloop && slider.direction !== "next") { slidestring = (reverse) ? (slider.count + slider.cloneoffset) * dimension : 0; } else if (slider.currentslide === slider.last && target === 0 && slider.vars.animationloop && slider.direction !== "prev") { slidestring = (reverse) ? 0 : (slider.count + 1) * dimension; } else { slidestring = (reverse) ? ((slider.count - 1) - target + slider.cloneoffset) * dimension : (target + slider.cloneoffset) * dimension; } slider.setprops(slidestring, "", slider.vars.animationspeed); if (slider.transitions) { if (!slider.vars.animationloop || !slider.atend) { slider.animating = false; slider.currentslide = slider.animatingto; } // unbind previous transitionend events and re-bind new transitionend event slider.container.unbind("webkittransitionend transitionend"); slider.container.bind("webkittransitionend transitionend", function() { cleartimeout(slider.ensureanimationend); slider.wrapup(dimension); }); // insurance for the ever-so-fickle transitionend event cleartimeout(slider.ensureanimationend); slider.ensureanimationend = settimeout(function() { slider.wrapup(dimension); }, slider.vars.animationspeed + 100); } else { slider.container.animate(slider.args, slider.vars.animationspeed, slider.vars.easing, function(){ slider.wrapup(dimension); }); } } else { // fade: if (!touch) { slider.slides.eq(slider.currentslide).css({"zindex": 1}).animate({"opacity": 0}, slider.vars.animationspeed, slider.vars.easing); slider.slides.eq(target).css({"zindex": 2}).animate({"opacity": 1}, slider.vars.animationspeed, slider.vars.easing, slider.wrapup); } else { slider.slides.eq(slider.currentslide).css({ "opacity": 0, "zindex": 1 }); slider.slides.eq(target).css({ "opacity": 1, "zindex": 2 }); slider.wrapup(dimension); } } // smooth height: if (slider.vars.smoothheight) { methods.smoothheight(slider.vars.animationspeed); } } }; slider.wrapup = function(dimension) { // slide: if (!fade && !carousel) { if (slider.currentslide === 0 && slider.animatingto === slider.last && slider.vars.animationloop) { slider.setprops(dimension, "jumpend"); } else if (slider.currentslide === slider.last && slider.animatingto === 0 && slider.vars.animationloop) { slider.setprops(dimension, "jumpstart"); } } slider.animating = false; slider.currentslide = slider.animatingto; // api: after() animation callback slider.vars.after(slider); }; // slideshow: slider.animateslides = function() { if (!slider.animating && focused ) { slider.flexanimate(slider.gettarget("next")); } }; // slideshow: slider.pause = function() { clearinterval(slider.animatedslides); slider.animatedslides = null; slider.playing = false; // pauseplay: if (slider.vars.pauseplay) { methods.pauseplay.update("play"); } // sync: if (slider.syncexists) { methods.sync("pause"); } }; // slideshow: slider.play = function() { if (slider.playing) { clearinterval(slider.animatedslides); } slider.animatedslides = slider.animatedslides || setinterval(slider.animateslides, slider.vars.slideshowspeed); slider.started = slider.playing = true; // pauseplay: if (slider.vars.pauseplay) { methods.pauseplay.update("pause"); } // sync: if (slider.syncexists) { methods.sync("play"); } }; // stop: slider.stop = function () { slider.pause(); slider.stopped = true; }; slider.canadvance = function(target, fromnav) { // asnav: var last = (asnav) ? slider.pagingcount - 1 : slider.last; return (fromnav) ? true : (asnav && slider.currentitem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true : (asnav && slider.currentitem === 0 && target === slider.pagingcount - 1 && slider.direction !== "next") ? false : (target === slider.currentslide && !asnav) ? false : (slider.vars.animationloop) ? true : (slider.atend && slider.currentslide === 0 && target === last && slider.direction !== "next") ? false : (slider.atend && slider.currentslide === last && target === 0 && slider.direction === "next") ? false : true; }; slider.gettarget = function(dir) { slider.direction = dir; if (dir === "next") { return (slider.currentslide === slider.last) ? 0 : slider.currentslide + 1; } else { return (slider.currentslide === 0) ? slider.last : slider.currentslide - 1; } }; // slide: slider.setprops = function(pos, special, dur) { var target = (function() { var poscheck = (pos) ? pos : ((slider.itemw + slider.vars.itemmargin) * slider.move) * slider.animatingto, poscalc = (function() { if (carousel) { return (special === "settouch") ? pos : (reverse && slider.animatingto === slider.last) ? 0 : (reverse) ? slider.limit - (((slider.itemw + slider.vars.itemmargin) * slider.move) * slider.animatingto) : (slider.animatingto === slider.last) ? slider.limit : poscheck; } else { switch (special) { case "settotal": return (reverse) ? ((slider.count - 1) - slider.currentslide + slider.cloneoffset) * pos : (slider.currentslide + slider.cloneoffset) * pos; case "settouch": return (reverse) ? pos : pos; case "jumpend": return (reverse) ? pos : slider.count * pos; case "jumpstart": return (reverse) ? slider.count * pos : pos; default: return pos; } } }()); return (poscalc * -1) + "px"; }()); if (slider.transitions) { target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)"; dur = (dur !== undefined) ? (dur/1000) + "s" : "0s"; slider.container.css("-" + slider.pfx + "-transition-duration", dur); slider.container.css("transition-duration", dur); } slider.args[slider.prop] = target; if (slider.transitions || dur === undefined) { slider.container.css(slider.args); } slider.container.css('transform',target); }; slider.setup = function(type) { // slide: if (!fade) { var slideroffset, arr; if (type === "init") { slider.viewport = $('
      ').css({"overflow": "hidden", "position": "relative"}).appendto(slider).append(slider.container); // infinite loop: slider.clonecount = 0; slider.cloneoffset = 0; // reverse: if (reverse) { arr = $.makearray(slider.slides).reverse(); slider.slides = $(arr); slider.container.empty().append(slider.slides); } } // infinite loop && !carousel: if (slider.vars.animationloop && !carousel) { slider.clonecount = 2; slider.cloneoffset = 1; // clear out old clones if (type !== "init") { slider.container.find('.clone').remove(); } slider.container.append(methods.uniqueid(slider.slides.first().clone().addclass('clone')).attr('aria-hidden', 'true')) .prepend(methods.uniqueid(slider.slides.last().clone().addclass('clone')).attr('aria-hidden', 'true')); } slider.newslides = $(slider.vars.selector, slider); slideroffset = (reverse) ? slider.count - 1 - slider.currentslide + slider.cloneoffset : slider.currentslide + slider.cloneoffset; // vertical: if (vertical && !carousel) { slider.container.height((slider.count + slider.clonecount) * 200 + "%").css("position", "absolute").width("100%"); settimeout(function(){ slider.newslides.css({"display": "block"}); slider.domath(); slider.viewport.height(slider.h); slider.setprops(slideroffset * slider.h, "init"); }, (type === "init") ? 100 : 0); } else { slider.container.width((slider.count + slider.clonecount) * 200 + "%"); slider.setprops(slideroffset * slider.computedw, "init"); settimeout(function(){ slider.domath(); slider.newslides.css({"width": slider.computedw, "marginright" : slider.computedm, "float": "left", "display": "block"}); // smooth height: if (slider.vars.smoothheight) { methods.smoothheight(); } }, (type === "init") ? 100 : 0); } } else { // fade: slider.slides.css({"width": "100%", "float": "left", "marginright": "-100%", "position": "relative"}); if (type === "init") { if (!touch) { //slider.slides.eq(slider.currentslide).fadein(slider.vars.animationspeed, slider.vars.easing); if (slider.vars.fadefirstslide == false) { slider.slides.css({ "opacity": 0, "display": "block", "zindex": 1 }).eq(slider.currentslide).css({"zindex": 2}).css({"opacity": 1}); } else { slider.slides.css({ "opacity": 0, "display": "block", "zindex": 1 }).eq(slider.currentslide).css({"zindex": 2}).animate({"opacity": 1},slider.vars.animationspeed,slider.vars.easing); } } else { slider.slides.css({ "opacity": 0, "display": "block", "webkittransition": "opacity " + slider.vars.animationspeed / 1000 + "s ease", "zindex": 1 }).eq(slider.currentslide).css({ "opacity": 1, "zindex": 2}); } } // smooth height: if (slider.vars.smoothheight) { methods.smoothheight(); } } // !carousel: // candidate: active slide if (!carousel) { slider.slides.removeclass(namespace + "active-slide").eq(slider.currentslide).addclass(namespace + "active-slide"); } //flexslider: init() callback slider.vars.init(slider); }; slider.domath = function() { var slide = slider.slides.first(), slidemargin = slider.vars.itemmargin, minitems = slider.vars.minitems, maxitems = slider.vars.maxitems; slider.w = (slider.viewport===undefined) ? slider.width() : slider.viewport.width(); slider.h = slide.height(); slider.boxpadding = slide.outerwidth() - slide.width(); // carousel: if (carousel) { slider.itemt = slider.vars.itemwidth + slidemargin; slider.itemm = slidemargin; slider.minw = (minitems) ? minitems * slider.itemt : slider.w; slider.maxw = (maxitems) ? (maxitems * slider.itemt) - slidemargin : slider.w; slider.itemw = (slider.minw > slider.w) ? (slider.w - (slidemargin * (minitems - 1)))/minitems : (slider.maxw < slider.w) ? (slider.w - (slidemargin * (maxitems - 1)))/maxitems : (slider.vars.itemwidth > slider.w) ? slider.w : slider.vars.itemwidth; slider.visible = math.floor(slider.w/(slider.itemw)); slider.move = (slider.vars.move > 0 && slider.vars.move < slider.visible ) ? slider.vars.move : slider.visible; slider.pagingcount = math.ceil(((slider.count - slider.visible)/slider.move) + 1); slider.last = slider.pagingcount - 1; slider.limit = (slider.pagingcount === 1) ? 0 : (slider.vars.itemwidth > slider.w) ? (slider.itemw * (slider.count - 1)) + (slidemargin * (slider.count - 1)) : ((slider.itemw + slidemargin) * slider.count) - slider.w - slidemargin; } else { slider.itemw = slider.w; slider.itemm = slidemargin; slider.pagingcount = slider.count; slider.last = slider.count - 1; } slider.computedw = slider.itemw - slider.boxpadding; slider.computedm = slider.itemm; }; slider.update = function(pos, action) { slider.domath(); // update currentslide and slider.animatingto if necessary if (!carousel) { if (pos < slider.currentslide) { slider.currentslide += 1; } else if (pos <= slider.currentslide && pos !== 0) { slider.currentslide -= 1; } slider.animatingto = slider.currentslide; } // update controlnav if (slider.vars.controlnav && !slider.manualcontrols) { if ((action === "add" && !carousel) || slider.pagingcount > slider.controlnav.length) { methods.controlnav.update("add"); } else if ((action === "remove" && !carousel) || slider.pagingcount < slider.controlnav.length) { if (carousel && slider.currentslide > slider.last) { slider.currentslide -= 1; slider.animatingto -= 1; } methods.controlnav.update("remove", slider.last); } } // update directionnav if (slider.vars.directionnav) { methods.directionnav.update(); } }; slider.addslide = function(obj, pos) { var $obj = $(obj); slider.count += 1; slider.last = slider.count - 1; // append new slide if (vertical && reverse) { (pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj); } else { (pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj); } // update currentslide, animatingto, controlnav, and directionnav slider.update(pos, "add"); // update slider.slides slider.slides = $(slider.vars.selector + ':not(.clone)', slider); // re-setup the slider to accomdate new slide slider.setup(); //flexslider: added() callback slider.vars.added(slider); }; slider.removeslide = function(obj) { var pos = (isnan(obj)) ? slider.slides.index($(obj)) : obj; // update count slider.count -= 1; slider.last = slider.count - 1; // remove slide if (isnan(obj)) { $(obj, slider.slides).remove(); } else { (vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove(); } // update currentslide, animatingto, controlnav, and directionnav slider.domath(); slider.update(pos, "remove"); // update slider.slides slider.slides = $(slider.vars.selector + ':not(.clone)', slider); // re-setup the slider to accomdate new slide slider.setup(); // flexslider: removed() callback slider.vars.removed(slider); }; //flexslider: initialize methods.init(); }; // ensure the slider isn't focussed if the window loses focus. $( window ).blur( function ( e ) { focused = false; }).focus( function ( e ) { focused = true; }); //flexslider: default settings $.flexslider.defaults = { namespace: "flex-", //{new} string: prefix string attached to the class of every element generated by the plugin selector: ".slides > li", //{new} selector: must match a simple pattern. '{container} > {slide}' -- ignore pattern at your own peril animation: "fade", //string: select your animation type, "fade" or "slide" easing: "swing", //{new} string: determines the easing method used in jquery transitions. jquery easing plugin is supported! direction: "horizontal", //string: select the sliding direction, "horizontal" or "vertical" reverse: false, //{new} boolean: reverse the animation direction animationloop: true, //boolean: should the animation loop? if false, directionnav will received "disable" classes at either end smoothheight: false, //{new} boolean: allow height of the slider to animate smoothly in horizontal mode startat: 0, //integer: the slide that the slider should start on. array notation (0 = first slide) slideshow: true, //boolean: animate slider automatically slideshowspeed: 7000, //integer: set the speed of the slideshow cycling, in milliseconds animationspeed: 600, //integer: set the speed of animations, in milliseconds initdelay: 0, //{new} integer: set an initialization delay, in milliseconds randomize: false, //boolean: randomize slide order fadefirstslide: true, //boolean: fade in the first slide when animation type is "fade" thumbcaptions: false, //boolean: whether or not to put captions on thumbnails when using the "thumbnails" controlnav. // usability features pauseonaction: true, //boolean: pause the slideshow when interacting with control elements, highly recommended. pauseonhover: false, //boolean: pause the slideshow when hovering over slider, then resume when no longer hovering pauseinvisible: true, //{new} boolean: pause the slideshow when tab is invisible, resume when visible. provides better ux, lower cpu usage. usecss: true, //{new} boolean: slider will use css3 transitions if available touch: true, //{new} boolean: allow touch swipe navigation of the slider on touch-enabled devices video: false, //{new} boolean: if using video in the slider, will prevent css3 3d transforms to avoid graphical glitches // primary controls controlnav: true, //boolean: create navigation for paging control of each slide? note: leave true for manualcontrols usage directionnav: true, //boolean: create navigation for previous/next navigation? (true/false) prevtext: "previous", //string: set the text for the "previous" directionnav item nexttext: "next", //string: set the text for the "next" directionnav item // secondary navigation keyboard: true, //boolean: allow slider navigating via keyboard left/right keys multiplekeyboard: false, //{new} boolean: allow keyboard navigation to affect multiple sliders. default behavior cuts out keyboard navigation with more than one slider present. mousewheel: false, //{updated} boolean: requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - allows slider navigating via mousewheel pauseplay: false, //boolean: create pause/play dynamic element pausetext: "pause", //string: set the text for the "pause" pauseplay item playtext: "play", //string: set the text for the "play" pauseplay item // special properties controlscontainer: "", //{updated} jquery object/selector: declare which container the navigation elements should be appended too. default container is the flexslider element. example use would be $(".flexslider-container"). property is ignored if given element is not found. manualcontrols: "", //{updated} jquery object/selector: declare custom control navigation. examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. the number of elements in your controlnav should match the number of slides/tabs. customdirectionnav: "", //{new} jquery object/selector: custom prev / next button. must be two jquery elements. in order to make the events work they have to have the classes "prev" and "next" (plus namespace) sync: "", //{new} selector: mirror the actions performed on this slider with another slider. use with care. asnavfor: "", //{new} selector: internal property exposed for turning the slider into a thumbnail navigation for another slider // carousel options itemwidth: 0, //{new} integer: box-model width of individual carousel items, including horizontal borders and padding. itemmargin: 0, //{new} integer: margin between carousel items. minitems: 1, //{new} integer: minimum number of carousel items that should be visible. items will resize fluidly when below this. maxitems: 0, //{new} integer: maxmimum number of carousel items that should be visible. items will resize fluidly when above this limit. move: 0, //{new} integer: number of carousel items that should move on animation. if 0, slider will move all visible items. allowoneslide: true, //{new} boolean: whether or not to allow a slider comprised of a single slide // callback api start: function(){}, //callback: function(slider) - fires when the slider loads the first slide before: function(){}, //callback: function(slider) - fires asynchronously with each slider animation after: function(){}, //callback: function(slider) - fires after each slider animation completes end: function(){}, //callback: function(slider) - fires when the slider reaches the last slide (asynchronous) added: function(){}, //{new} callback: function(slider) - fires after a slide is added removed: function(){}, //{new} callback: function(slider) - fires after a slide is removed init: function() {} //{new} callback: function(slider) - fires after the slider is initially setup }; //flexslider: plugin function $.fn.flexslider = function(options) { if (options === undefined) { options = {}; } if (typeof options === "object") { return this.each(function() { var $this = $(this), selector = (options.selector) ? options.selector : ".slides > li", $slides = $this.find(selector); if ( ( $slides.length === 1 && options.allowoneslide === false ) || $slides.length === 0 ) { $slides.fadein(400); if (options.start) { options.start($this); } } else if ($this.data('flexslider') === undefined) { new $.flexslider(this, options); } }); } else { // helper strings to quickly perform functions on the slider var $slider = $(this).data('flexslider'); switch (options) { case "play": $slider.play(); break; case "pause": $slider.pause(); break; case "stop": $slider.stop(); break; case "next": $slider.flexanimate($slider.gettarget("next"), true); break; case "prev": case "previous": $slider.flexanimate($slider.gettarget("prev"), true); break; default: if (typeof options === "number") { $slider.flexanimate(options, true); } } } }; })(jquery); /*flexslider end*/