Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merges #628 into master.

  • Loading branch information...
commit 0d43ffbf13ce9f52505c3406a7def81c5a56ec3e 2 parents 50a06a1 + 30141e6
@mattyza mattyza authored
Showing with 1,147 additions and 1 deletion.
  1. +1,138 −1 jquery.flexslider-min.js
  2. +9 −0 jquery.flexslider.js
View
1,139 jquery.flexslider-min.js
@@ -2,4 +2,1141 @@
* jQuery FlexSlider v2.3.0-bleeding
* Copyright 2012 WooThemes
* Contributing Author: Tyler Smith
- */(function(e){e.flexslider=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider.defaults,n);var i=r.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,o=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,u="click touchend MSPointerUp",a="",f,l=r.vars.direction==="vertical",c=r.vars.reverse,h=r.vars.itemWidth>0,p=r.vars.animation==="fade",d=r.vars.asNavFor!=="",v={},m=!0;e.data(t,"flexslider",r);v={init:function(){r.animating=!1;r.currentSlide=parseInt(r.vars.startAt?r.vars.startAt:0,10);isNaN(r.currentSlide)&&(r.currentSlide=0);r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides.length;r.syncExists=e(r.vars.sync).length>0;r.vars.animation==="slide"&&(r.vars.animation="swing");r.prop=l?"top":"marginLeft";r.args={};r.manualPause=!1;r.stopped=!1;r.started=!1;r.startTimeout=null;r.transitions=!r.vars.video&&!p&&r.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t)if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("Perspective","").toLowerCase();r.prop="-"+r.pfx+"-transform";return!0}return!1}();r.vars.controlsContainer!==""&&(r.controlsContainer=e(r.vars.controlsContainer).length>0&&e(r.vars.controlsContainer));r.vars.manualControls!==""&&(r.manualControls=e(r.vars.manualControls).length>0&&e(r.vars.manualControls));if(r.vars.randomize){r.slides.sort(function(){return Math.round(Math.random())-.5});r.container.empty().append(r.slides)}r.doMath();r.setup("init");r.vars.controlNav&&v.controlNav.setup();r.vars.directionNav&&v.directionNav.setup();r.vars.keyboard&&(e(r.containerSelector).length===1||r.vars.multipleKeyboard)&&e(document).bind("keyup",function(e){var t=e.keyCode;if(!r.animating&&(t===39||t===37)){var n=t===39?r.getTarget("next"):t===37?r.getTarget("prev"):!1;r.flexAnimate(n,r.vars.pauseOnAction)}});r.vars.mousewheel&&r.bind("mousewheel",function(e,t,n,i){e.preventDefault();var s=t<0?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(s,r.vars.pauseOnAction)});r.vars.pausePlay&&v.pausePlay.setup();r.vars.slideshow&&r.vars.pauseInvisible&&v.pauseInvisible.init();if(r.vars.slideshow){r.vars.pauseOnHover&&r.hover(function(){!r.manualPlay&&!r.manualPause&&r.pause()},function(){!r.manualPause&&!r.manualPlay&&!r.stopped&&r.play()});if(!r.vars.pauseInvisible||!v.pauseInvisible.isHidden())r.vars.initDelay>0?r.startTimeout=setTimeout(r.play,r.vars.initDelay):r.play()}d&&v.asNav.setup();o&&r.vars.touch&&v.touch();(!p||p&&r.vars.smoothHeight)&&e(window).bind("resize orientationchange focus",v.resize);r.find("img").attr("draggable","false");setTimeout(function(){r.vars.start(r)},200)},asNav:{setup:function(){r.asNav=!0;r.animatingTo=Math.floor(r.currentSlide/r.move);r.currentItem=r.currentSlide;r.slides.removeClass(i+"active-slide").eq(r.currentItem).addClass(i+"active-slide");if(!s)r.slides.on(u,function(t){t.preventDefault();var n=e(this),s=n.index(),o=n.offset().left-e(r).scrollLeft();if(o<=0&&n.hasClass(i+"active-slide"))r.flexAnimate(r.getTarget("prev"),!0);else if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass(i+"active-slide")){r.direction=r.currentItem<s?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction,!1,!0,!0)}});else{t._slider=r;r.slides.each(function(){var t=this;t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",function(e){e.preventDefault();e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1);t.addEventListener("MSGestureTap",function(t){t.preventDefault();var n=e(this),i=n.index();if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass("active")){r.direction=r.currentItem<i?"next":"prev";r.flexAnimate(i,r.vars.pauseOnAction,!1,!0,!0)}})})}}},controlNav:{setup:function(){r.manualControls?v.controlNav.setupManual():v.controlNav.setupPaging()},setupPaging:function(){var t=r.vars.controlNav==="thumbnails"?"control-thumbs":"control-paging",n=1,s,o;r.controlNavScaffold=e('<ol class="'+i+"control-nav "+i+t+'"></ol>');if(r.pagingCount>1)for(var f=0;f<r.pagingCount;f++){o=r.slides.eq(f);s=r.vars.controlNav==="thumbnails"?'<img src="'+o.attr("data-thumb")+'"/>':"<a>"+n+"</a>";if("thumbnails"===r.vars.controlNav&&!0===r.vars.thumbCaptions){var l=o.attr("data-thumbcaption");""!=l&&undefined!=l&&(s+='<span class="'+i+'caption">'+l+"</span>")}r.controlNavScaffold.append("<li>"+s+"</li>");n++}r.controlsContainer?e(r.controlsContainer).append(r.controlNavScaffold):r.append(r.controlNavScaffold);v.controlNav.set();v.controlNav.active();r.controlNavScaffold.delegate("a, img",u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){r.direction=s>r.currentSlide?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction)}}a===""&&(a=t.type);v.setToClearWatchedEvent()})},setupManual:function(){r.controlNav=r.manualControls;v.controlNav.active();r.controlNav.bind(u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){s>r.currentSlide?r.direction="next":r.direction="prev";r.flexAnimate(s,r.vars.pauseOnAction)}}a===""&&(a=t.type);v.setToClearWatchedEvent()})},set:function(){var t=r.vars.controlNav==="thumbnails"?"img":"a";r.controlNav=e("."+i+"control-nav li "+t,r.controlsContainer?r.controlsContainer:r)},active:function(){r.controlNav.removeClass(i+"active").eq(r.animatingTo).addClass(i+"active")},update:function(t,n){r.pagingCount>1&&t==="add"?r.controlNavScaffold.append(e("<li><a>"+r.count+"</a></li>")):r.pagingCount===1?r.controlNavScaffold.find("li").remove():r.controlNav.eq(n).closest("li").remove();v.controlNav.set();r.pagingCount>1&&r.pagingCount!==r.controlNav.length?r.update(n,t):v.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+i+'direction-nav"><li><a class="'+i+'prev" href="#">'+r.vars.prevText+'</a></li><li><a class="'+i+'next" href="#">'+r.vars.nextText+"</a></li></ul>");if(r.controlsContainer){e(r.controlsContainer).append(t);r.directionNav=e("."+i+"direction-nav li a",r.controlsContainer)}else{r.append(t);r.directionNav=e("."+i+"direction-nav li a",r)}v.directionNav.update();r.directionNav.bind(u,function(t){t.preventDefault();var n;if(a===""||a===t.type){n=e(this).hasClass(i+"next")?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(n,r.vars.pauseOnAction)}a===""&&(a=t.type);v.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";r.pagingCount===1?r.directionNav.addClass(e).attr("tabindex","-1"):r.vars.animationLoop?r.directionNav.removeClass(e).removeAttr("tabindex"):r.animatingTo===0?r.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):r.animatingTo===r.last?r.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):r.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var t=e('<div class="'+i+'pauseplay"><a></a></div>');if(r.controlsContainer){r.controlsContainer.append(t);r.pausePlay=e("."+i+"pauseplay a",r.controlsContainer)}else{r.append(t);r.pausePlay=e("."+i+"pauseplay a",r)}v.pausePlay.update(r.vars.slideshow?i+"pause":i+"play");r.pausePlay.bind(u,function(t){t.preventDefault();if(a===""||a===t.type)if(e(this).hasClass(i+"pause")){r.manualPause=!0;r.manualPlay=!1;r.pause()}else{r.manualPause=!1;r.manualPlay=!0;r.play()}a===""&&(a=t.type);v.setToClearWatchedEvent()})},update:function(e){e==="play"?r.pausePlay.removeClass(i+"pause").addClass(i+"play").html(r.vars.playText):r.pausePlay.removeClass(i+"play").addClass(i+"pause").html(r.vars.pauseText)}},touch:function(){var e,n,i,o,u,a,f=!1,d=0,v=0,m=0;if(!s){t.addEventListener("touchstart",g,!1);function g(s){if(r.animating)s.preventDefault();else if(window.navigator.msPointerEnabled||s.touches.length===1){r.pause();o=l?r.h:r.w;a=Number(new Date);d=s.touches[0].pageX;v=s.touches[0].pageY;i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o;e=l?v:d;n=l?d:v;t.addEventListener("touchmove",y,!1);t.addEventListener("touchend",b,!1)}}function y(t){d=t.touches[0].pageX;v=t.touches[0].pageY;u=l?e-v:e-d;f=l?Math.abs(u)<Math.abs(d-n):Math.abs(u)<Math.abs(v-n);var s=500;if(!f||Number(new Date)-a>s){t.preventDefault();if(!p&&r.transitions){r.vars.animationLoop||(u/=r.currentSlide===0&&u<0||r.currentSlide===r.last&&u>0?Math.abs(u)/o+2:1);r.setProps(i+u,"setTouch")}}}function b(s){t.removeEventListener("touchmove",y,!1);if(r.animatingTo===r.currentSlide&&!f&&u!==null){var l=c?-u:u,h=l>0?r.getTarget("next"):r.getTarget("prev");r.canAdvance(h)&&(Number(new Date)-a<550&&Math.abs(l)>50||Math.abs(l)>o/2)?r.flexAnimate(h,r.vars.pauseOnAction):p||r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,!0)}t.removeEventListener("touchend",b,!1);e=null;n=null;u=null;i=null}}else{t.style.msTouchAction="none";t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",w,!1);t._slider=r;t.addEventListener("MSGestureChange",E,!1);t.addEventListener("MSGestureEnd",S,!1);function w(e){e.stopPropagation();if(r.animating)e.preventDefault();else{r.pause();t._gesture.addPointer(e.pointerId);m=0;o=l?r.h:r.w;a=Number(new Date);i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o}}function E(e){e.stopPropagation();var n=e.target._slider;if(!n)return;var r=-e.translationX,s=-e.translationY;m+=l?s:r;u=m;f=l?Math.abs(m)<Math.abs(-r):Math.abs(m)<Math.abs(-s);if(e.detail===e.MSGESTURE_FLAG_INERTIA){setImmediate(function(){t._gesture.stop()});return}if(!f||Number(new Date)-a>500){e.preventDefault();if(!p&&n.transitions){n.vars.animationLoop||(u=m/(n.currentSlide===0&&m<0||n.currentSlide===n.last&&m>0?Math.abs(m)/o+2:1));n.setProps(i+u,"setTouch")}}}function S(t){t.stopPropagation();var r=t.target._slider;if(!r)return;if(r.animatingTo===r.currentSlide&&!f&&u!==null){var s=c?-u:u,l=s>0?r.getTarget("next"):r.getTarget("prev");r.canAdvance(l)&&(Number(new Date)-a<550&&Math.abs(s)>50||Math.abs(s)>o/2)?r.flexAnimate(l,r.vars.pauseOnAction):p||r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,!0)}e=null;n=null;u=null;i=null;m=0}}},resize:function(){if(!r.animating&&r.is(":visible")){h||r.doMath();if(p)v.smoothHeight();else if(h){r.slides.width(r.computedW);r.update(r.pagingCount);r.setProps()}else if(l){r.viewport.height(r.h);r.setProps(r.h,"setTotal")}else{r.vars.smoothHeight&&v.smoothHeight();r.newSlides.width(r.computedW);r.setProps(r.computedW,"setTotal")}}},smoothHeight:function(e){if(!l||p){var t=p?r:r.viewport;e?t.animate({height:r.slides.eq(r.animatingTo).height()},e):t.height(r.slides.eq(r.animatingTo).height())}},sync:function(t){var n=e(r.vars.sync).data("flexslider"),i=r.animatingTo;switch(t){case"animate":n.flexAnimate(i,r.vars.pauseOnAction,!1,!0);break;case"play":!n.playing&&!n.asNav&&n.play();break;case"pause":n.pause()}},pauseInvisible:{visProp:null,init:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)e[t]+"Hidden"in document&&(v.pauseInvisible.visProp=e[t]+"Hidden");if(v.pauseInvisible.visProp){var n=v.pauseInvisible.visProp.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(n,function(){v.pauseInvisible.isHidden()?r.startTimeout?clearTimeout(r.startTimeout):r.pause():r.started?r.play():r.vars.initDelay>0?setTimeout(r.play,r.vars.initDelay):r.play()})}},isHidden:function(){return document[v.pauseInvisible.visProp]||!1}},setToClearWatchedEvent:function(){clearTimeout(f);f=setTimeout(function(){a=""},3e3)}};r.flexAnimate=function(t,n,s,u,a){!r.vars.animationLoop&&t!==r.currentSlide&&(r.direction=t>r.currentSlide?"next":"prev");d&&r.pagingCount===1&&(r.direction=r.currentItem<t?"next":"prev");if(!r.animating&&(r.canAdvance(t,a)||s)&&r.is(":visible")){if(d&&u){var f=e(r.vars.asNavFor).data("flexslider");r.atEnd=t===0||t===r.count-1;f.flexAnimate(t,!0,!1,!0,a);r.direction=r.currentItem<t?"next":"prev";f.direction=r.direction;if(Math.ceil((t+1)/r.visible)-1===r.currentSlide||t===0){r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");return!1}r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");t=Math.floor(t/r.visible)}r.animating=!0;r.animatingTo=t;n&&r.pause();r.vars.before(r);r.syncExists&&!a&&v.sync("animate");r.vars.controlNav&&v.controlNav.active();h||r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");r.atEnd=t===0||t===r.last;r.vars.directionNav&&v.directionNav.update();if(t===r.last){r.vars.end(r);r.vars.animationLoop||r.pause()}if(!p){var m=l?r.slides.filter(":first").height():r.computedW,g,y,b;if(h){g=r.vars.itemMargin;b=(r.itemW+g)*r.move*r.animatingTo;y=b>r.limit&&r.visible!==1?r.limit:b}else r.currentSlide===0&&t===r.count-1&&r.vars.animationLoop&&r.direction!=="next"?y=c?(r.count+r.cloneOffset)*m:0:r.currentSlide===r.last&&t===0&&r.vars.animationLoop&&r.direction!=="prev"?y=c?0:(r.count+1)*m:y=c?(r.count-1-t+r.cloneOffset)*m:(t+r.cloneOffset)*m;r.setProps(y,"",r.vars.animationSpeed);if(r.transitions){if(!r.vars.animationLoop||!r.atEnd){r.animating=!1;r.currentSlide=r.animatingTo}r.container.unbind("webkitTransitionEnd transitionend");r.container.bind("webkitTransitionEnd transitionend",function(){r.wrapup(m)})}else r.container.animate(r.args,r.vars.animationSpeed,r.vars.easing,function(){r.wrapup(m)})}else if(!o){r.slides.eq(r.currentSlide).css({zIndex:1}).animate({opacity:0},r.vars.animationSpeed,r.vars.easing);r.slides.eq(t).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing,r.wrapup)}else{r.slides.eq(r.currentSlide).css({opacity:0,zIndex:1});r.slides.eq(t).css({opacity:1,zIndex:2});r.wrapup(m)}r.vars.smoothHeight&&v.smoothHeight(r.vars.animationSpeed)}};r.wrapup=function(e){!p&&!h&&(r.currentSlide===0&&r.animatingTo===r.last&&r.vars.animationLoop?r.setProps(e,"jumpEnd"):r.currentSlide===r.last&&r.animatingTo===0&&r.vars.animationLoop&&r.setProps(e,"jumpStart"));r.animating=!1;r.currentSlide=r.animatingTo;r.vars.after(r)};r.animateSlides=function(){!r.animating&&m&&r.flexAnimate(r.getTarget("next"))};r.pause=function(){clearInterval(r.animatedSlides);r.animatedSlides=null;r.playing=!1;r.vars.pausePlay&&v.pausePlay.update("play");r.syncExists&&v.sync("pause")};r.play=function(){r.playing&&clearInterval(r.animatedSlides);r.animatedSlides=r.animatedSlides||setInterval(r.animateSlides,r.vars.slideshowSpeed);r.started=r.playing=!0;r.vars.pausePlay&&v.pausePlay.update("pause");r.syncExists&&v.sync("play")};r.stop=function(){r.pause();r.stopped=!0};r.canAdvance=function(e,t){var n=d?r.pagingCount-1:r.last;return t?!0:d&&r.currentItem===r.count-1&&e===0&&r.direction==="prev"?!0:d&&r.currentItem===0&&e===r.pagingCount-1&&r.direction!=="next"?!1:e===r.currentSlide&&!d?!1:r.vars.animationLoop?!0:r.atEnd&&r.currentSlide===0&&e===n&&r.direction!=="next"?!1:r.atEnd&&r.currentSlide===n&&e===0&&r.direction==="next"?!1:!0};r.getTarget=function(e){r.direction=e;return e==="next"?r.currentSlide===r.last?0:r.currentSlide+1:r.currentSlide===0?r.last:r.currentSlide-1};r.setProps=function(e,t,n){var i=function(){var n=e?e:(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo,i=function(){if(h)return t==="setTouch"?e:c&&r.animatingTo===r.last?0:c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:r.animatingTo===r.last?r.limit:n;switch(t){case"setTotal":return c?(r.count-1-r.currentSlide+r.cloneOffset)*e:(r.currentSlide+r.cloneOffset)*e;case"setTouch":return c?e:e;case"jumpEnd":return c?e:r.count*e;case"jumpStart":return c?r.count*e:e;default:return e}}();return i*-1+"px"}();if(r.transitions){i=l?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)";n=n!==undefined?n/1e3+"s":"0s";r.container.css("-"+r.pfx+"-transition-duration",n)}r.args[r.prop]=i;(r.transitions||n===undefined)&&r.container.css(r.args)};r.setup=function(t){if(!p){var n,s;if(t==="init"){r.viewport=e('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(r).append(r.container);r.cloneCount=0;r.cloneOffset=0;if(c){s=e.makeArray(r.slides).reverse();r.slides=e(s);r.container.empty().append(r.slides)}}if(r.vars.animationLoop&&!h){r.cloneCount=2;r.cloneOffset=1;t!=="init"&&r.container.find(".clone").remove();r.container.append(r.slides.first().clone().addClass("clone").attr("aria-hidden","true")).prepend(r.slides.last().clone().addClass("clone").attr("aria-hidden","true"))}r.newSlides=e(r.vars.selector,r);n=c?r.count-1-r.currentSlide+r.cloneOffset:r.currentSlide+r.cloneOffset;if(l&&!h){r.container.height((r.count+r.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){r.newSlides.css({display:"block"});r.doMath();r.viewport.height(r.h);r.setProps(n*r.h,"init")},t==="init"?100:0)}else{r.container.width((r.count+r.cloneCount)*200+"%");r.setProps(n*r.computedW,"init");setTimeout(function(){r.doMath();r.newSlides.css({width:r.computedW,"float":"left",display:"block"});r.vars.smoothHeight&&v.smoothHeight()},t==="init"?100:0)}}else{r.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"});t==="init"&&(o?r.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+r.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(r.currentSlide).css({opacity:1,zIndex:2}):r.slides.css({opacity:0,display:"block",zIndex:1}).eq(r.currentSlide).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing));r.vars.smoothHeight&&v.smoothHeight()}h||r.slides.removeClass(i+"active-slide").eq(r.currentSlide).addClass(i+"active-slide")};r.doMath=function(){var e=r.slides.first(),t=r.vars.itemMargin,n=r.vars.minItems,i=r.vars.maxItems;r.w=r.viewport===undefined?r.width():r.viewport.width();r.h=e.height();r.boxPadding=e.outerWidth()-e.width();if(h){r.itemT=r.vars.itemWidth+t;r.minW=n?n*r.itemT:r.w;r.maxW=i?i*r.itemT-t:r.w;r.itemW=r.minW>r.w?(r.w-t*(n-1))/n:r.maxW<r.w?(r.w-t*(i-1))/i:r.vars.itemWidth>r.w?r.w:r.vars.itemWidth;r.visible=Math.floor(r.w/r.itemW);r.move=r.vars.move>0&&r.vars.move<r.visible?r.vars.move:r.visible;r.pagingCount=Math.ceil((r.count-r.visible)/r.move+1);r.last=r.pagingCount-1;r.limit=r.pagingCount===1?0:r.vars.itemWidth>r.w?r.itemW*(r.count-1)+t*(r.count-1):(r.itemW+t)*r.count-r.w-t}else{r.itemW=r.w;r.pagingCount=r.count;r.last=r.count-1}r.computedW=r.itemW-r.boxPadding};r.update=function(e,t){r.doMath();if(!h){e<r.currentSlide?r.currentSlide+=1:e<=r.currentSlide&&e!==0&&(r.currentSlide-=1);r.animatingTo=r.currentSlide}if(r.vars.controlNav&&!r.manualControls)if(t==="add"&&!h||r.pagingCount>r.controlNav.length)v.controlNav.update("add");else if(t==="remove"&&!h||r.pagingCount<r.controlNav.length){if(h&&r.currentSlide>r.last){r.currentSlide-=1;r.animatingTo-=1}v.controlNav.update("remove",r.last)}r.vars.directionNav&&v.directionNav.update()};r.addSlide=function(t,n){var i=e(t);r.count+=1;r.last=r.count-1;l&&c?n!==undefined?r.slides.eq(r.count-n).after(i):r.container.prepend(i):n!==undefined?r.slides.eq(n).before(i):r.container.append(i);r.update(n,"add");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.added(r)};r.removeSlide=function(t){var n=isNaN(t)?r.slides.index(e(t)):t;r.count-=1;r.last=r.count-1;isNaN(t)?e(t,r.slides).remove():l&&c?r.slides.eq(r.last).remove():r.slides.eq(t).remove();r.doMath();r.update(n,"remove");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.removed(r)};v.init()};e(window).blur(function(e){focused=!1}).focus(function(e){focused=!0});e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};e.fn.flexslider=function(t){t===undefined&&(t={});if(typeof t=="object")return this.each(function(){var n=e(this),r=t.selector?t.selector:".slides > li",i=n.find(r);if(i.length===1&&t.allowOneSlide===!0||i.length===0){i.fadeIn(400);t.start&&t.start(n)}else n.data("flexslider")===undefined&&new e.flexslider(this,t)});var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"stop":n.stop();break;case"next":n.flexAnimate(n.getTarget("next"),!0);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),!0);break;default:typeof t=="number"&&n.flexAnimate(t,!0)}}})(jQuery);
+ */
+;
+(function ($) {
+
+ //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 = (touch) ? "touchend" : "click",
+ eventType = "click touchend MSPointerUp",
+ 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 = {},
+ focused = true;
+
+ // 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;
+ }());
+ // 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);
+
+ // 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 = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>');
+
+ if (slider.pagingCount > 1) {
+ for (var i = 0; i < slider.pagingCount; i++) {
+ slide = slider.slides.eq(i);
+ item = (slider.vars.controlNav === "thumbnails") ? '<img src="' + slide.attr( 'data-thumb' ) + '"/>' : '<a>' + j + '</a>';
+ if ( 'thumbnails' === slider.vars.controlNav && true === slider.vars.thumbCaptions ) {
+ var captn = slide.attr( 'data-thumbcaption' );
+ if ( '' != captn && undefined != captn ) item += '<span class="' + namespace + 'caption">' + captn + '</span>';
+ }
+ slider.controlNavScaffold.append('<li>' + item + '</li>');
+ 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($('<li><a>' + slider.count + '</a></li>'));
+ } 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 = $('<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + slider.vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + slider.vars.nextText + '</a></li></ul>');
+
+ // CONTROLSCONTAINER:
+ 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 = $('<div class="' + namespace + 'pauseplay"><a></a></div>');
+
+ // 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,
+ scrolling = false,
+ localX = 0,
+ localY = 0,
+ accDx = 0;
+
+ if(!msGesture){
+ el.addEventListener('touchstart', onTouchStart, false);
+
+ function onTouchStart(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);
+ }
+ }
+
+ function onTouchMove(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");
+ }
+ }
+ }
+
+ function onTouchEnd(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;
+ }
+ }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).height()}, dur) : $obj.height(slider.slides.eq(slider.animatingTo).height());
+ }
+ },
+ 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;
+ }
+ },
+<<<<<<< HEAD
+ pauseInvisible: {
+ visProp: null,
+ init: function() {
+ var prefixes = ['webkit','moz','ms','o'];
+
+ if ('hidden' in document) return 'hidden';
+ for (var i = 0; i < prefixes.length; i++) {
+ if ((prefixes[i] + 'Hidden') in document)
+ methods.pauseInvisible.visProp = prefixes[i] + 'Hidden';
+ }
+ if (methods.pauseInvisible.visProp) {
+ var evtname = methods.pauseInvisible.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 (slider.vars.initDelay > 0) ? setTimeout(slider.play, slider.vars.initDelay) : slider.play(); //Didn't init before: simply init or wait for it
+ }
+ });
+ }
+ },
+ isHidden: function() {
+ return document[methods.pauseInvisible.visProp] || false;
+ }
+ },
+ setToClearWatchedEvent: function() {
+ clearTimeout(watchedEventClearTimer);
+ watchedEventClearTimer = setTimeout(function() {
+ watchedEvent = "";
+ }, 3000);
+ }
+ };
+=======
+ uniqueID: function($clone) {
+ $clone.find( '[id]' ).each(function() {
+ var $this = $(this);
+ $this.attr( 'id', $this.attr( 'id' ) + '_clone' );
+ });
+ return $clone;
+ }
+ }
+>>>>>>> 30141e6d3b1da035c780a36d6417543853f5851e
+
+ // 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.itemWidth > slider.w) ? slider.vars.itemMargin * 2 : slider.vars.itemMargin;
+ 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;
+ }
+ slider.container.unbind("webkitTransitionEnd transitionend");
+ slider.container.bind("webkitTransitionEnd transitionend", function() {
+ slider.wrapup(dimension);
+ });
+ } 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).fadeOut(slider.vars.animationSpeed, slider.vars.easing);
+ //slider.slides.eq(target).fadeIn(slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
+
+ 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.args[slider.prop] = target;
+ if (slider.transitions || dur === undefined) slider.container.css(slider.args);
+ };
+
+ slider.setup = function(type) {
+ // SLIDE:
+ if (!fade) {
+ var sliderOffset, arr;
+
+ if (type === "init") {
+ slider.viewport = $('<div class="' + namespace + 'viewport"></div>').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();
+<<<<<<< HEAD
+ slider.container.append(slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true')).prepend(slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true'));
+=======
+
+ methods.uniqueID( slider.slides.first().clone().addClass('clone') ).appendTo( slider.container );
+ methods.uniqueID( slider.slides.last().clone().addClass('clone') ).prependTo( slider.container );
+>>>>>>> 30141e6d3b1da035c780a36d6417543853f5851e
+ }
+ 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, "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);
+ 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");
+ };
+
+ 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.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.pagingCount = slider.count;
+ slider.last = slider.count - 1;
+ }
+ slider.computedW = slider.itemW - slider.boxPadding;
+ };
+
+ 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
+ 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 clide? 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.
+ 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
+ };
+
+ //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 === true ) || $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);
View
9 jquery.flexslider.js
@@ -592,6 +592,13 @@
case "pause": $obj.pause(); break;
}
},
+ uniqueID: function($clone) {
+ $clone.find( '[id]' ).each(function() {
+ var $this = $(this);
+ $this.attr( 'id', $this.attr( 'id' ) + '_clone' );
+ });
+ return $clone;
+ },
pauseInvisible: {
visProp: null,
init: function() {
@@ -862,6 +869,8 @@
// clear out old clones
if (type !== "init") slider.container.find('.clone').remove();
slider.container.append(slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true')).prepend(slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true'));
+ methods.uniqueID( slider.slides.first().clone().addClass('clone') ).appendTo( slider.container );
+ methods.uniqueID( slider.slides.last().clone().addClass('clone') ).prependTo( slider.container );
}
slider.newSlides = $(slider.vars.selector, slider);
Please sign in to comment.
Something went wrong with that request. Please try again.