From 621b1da126c84669104f998d29110336dbb09bb3 Mon Sep 17 00:00:00 2001 From: Jeffrey Pearce Date: Mon, 22 Aug 2016 10:55:55 +0200 Subject: [PATCH 1/2] Adds missing demo files --- demo/css/flexslider.css | 275 ++++++++ demo/js/jquery.flexslider.js | 1195 ++++++++++++++++++++++++++++++++++ 2 files changed, 1470 insertions(+) create mode 100644 demo/css/flexslider.css create mode 100644 demo/js/jquery.flexslider.js diff --git a/demo/css/flexslider.css b/demo/css/flexslider.css new file mode 100644 index 00000000..88cbfb8b --- /dev/null +++ b/demo/css/flexslider.css @@ -0,0 +1,275 @@ +/* + * jQuery FlexSlider v2.6.2 + * http://www.woothemes.com/flexslider/ + * + * Copyright 2012 WooThemes + * Free to use under the GPLv2 and later license. + * http://www.gnu.org/licenses/gpl-2.0.html + * + * Contributing author: Tyler Smith (@mbmufffin) + * + */ +/* ==================================================================================================================== + * FONT-FACE + * ====================================================================================================================*/ +@font-face { + font-family: 'flexslider-icon'; + src: url('fonts/flexslider-icon.eot'); + src: url('fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'), url('fonts/flexslider-icon.woff') format('woff'), url('fonts/flexslider-icon.ttf') format('truetype'), url('fonts/flexslider-icon.svg#flexslider-icon') format('svg'); + font-weight: normal; + font-style: normal; +} +/* ==================================================================================================================== + * RESETS + * ====================================================================================================================*/ +.flex-container a:hover, +.flex-slider a:hover { + outline: none; +} +.slides, +.slides > li, +.flex-control-nav, +.flex-direction-nav { + margin: 0; + padding: 0; + list-style: none; +} +.flex-pauseplay span { + text-transform: capitalize; +} +/* ==================================================================================================================== + * BASE STYLES + * ====================================================================================================================*/ +.flexslider { + margin: 0; + padding: 0; +} +.flexslider .slides > li { + display: none; + -webkit-backface-visibility: hidden; +} +.flexslider .slides img { + width: 100%; + display: block; +} +.flexslider .slides:after { + content: "\0020"; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} +html[xmlns] .flexslider .slides { + display: block; +} +* html .flexslider .slides { + height: 1%; +} +.no-js .flexslider .slides > li:first-child { + display: block; +} +/* ==================================================================================================================== + * DEFAULT THEME + * ====================================================================================================================*/ +.flexslider { + margin: 0 0 60px; + background: #fff; + border: 4px solid #fff; + position: relative; + zoom: 1; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); + -moz-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); + -o-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); + box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); +} +.flexslider .slides { + zoom: 1; +} +.flexslider .slides img { + height: auto; + -moz-user-select: none; +} +.flex-viewport { + max-height: 2000px; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -ms-transition: all 1s ease; + -o-transition: all 1s ease; + transition: all 1s ease; +} +.loading .flex-viewport { + max-height: 300px; +} +.carousel li { + margin-right: 5px; +} +.flex-direction-nav { + *height: 0; +} +.flex-direction-nav a { + text-decoration: none; + display: block; + width: 40px; + height: 40px; + margin: -20px 0 0; + position: absolute; + top: 50%; + z-index: 10; + overflow: hidden; + opacity: 0; + cursor: pointer; + color: rgba(0, 0, 0, 0.8); + text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3); + -webkit-transition: all 0.3s ease-in-out; + -moz-transition: all 0.3s ease-in-out; + -ms-transition: all 0.3s ease-in-out; + -o-transition: all 0.3s ease-in-out; + transition: all 0.3s ease-in-out; +} +.flex-direction-nav a:before { + font-family: "flexslider-icon"; + font-size: 40px; + display: inline-block; + content: '\f001'; + color: rgba(0, 0, 0, 0.8); + text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3); +} +.flex-direction-nav a.flex-next:before { + content: '\f002'; +} +.flex-direction-nav .flex-prev { + left: -50px; +} +.flex-direction-nav .flex-next { + right: -50px; + text-align: right; +} +.flexslider:hover .flex-direction-nav .flex-prev { + opacity: 0.7; + left: 10px; +} +.flexslider:hover .flex-direction-nav .flex-prev:hover { + opacity: 1; +} +.flexslider:hover .flex-direction-nav .flex-next { + opacity: 0.7; + right: 10px; +} +.flexslider:hover .flex-direction-nav .flex-next:hover { + opacity: 1; +} +.flex-direction-nav .flex-disabled { + opacity: 0!important; + filter: alpha(opacity=0); + cursor: default; + z-index: -1; +} +.flex-pauseplay a { + display: block; + width: 20px; + height: 20px; + position: absolute; + bottom: 5px; + left: 10px; + opacity: 0.8; + z-index: 10; + overflow: hidden; + cursor: pointer; + color: #000; +} +.flex-pauseplay a:before { + font-family: "flexslider-icon"; + font-size: 20px; + display: inline-block; + content: '\f004'; +} +.flex-pauseplay a:hover { + opacity: 1; +} +.flex-pauseplay a.flex-play:before { + content: '\f003'; +} +.flex-control-nav { + width: 100%; + position: absolute; + bottom: -40px; + text-align: center; +} +.flex-control-nav li { + margin: 0 6px; + display: inline-block; + zoom: 1; + *display: inline; +} +.flex-control-paging li a { + width: 11px; + height: 11px; + display: block; + background: #666; + background: rgba(0, 0, 0, 0.5); + cursor: pointer; + text-indent: -9999px; + -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + -o-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + -webkit-border-radius: 20px; + -moz-border-radius: 20px; + border-radius: 20px; +} +.flex-control-paging li a:hover { + background: #333; + background: rgba(0, 0, 0, 0.7); +} +.flex-control-paging li a.flex-active { + background: #000; + background: rgba(0, 0, 0, 0.9); + cursor: default; +} +.flex-control-thumbs { + margin: 5px 0 0; + position: static; + overflow: hidden; +} +.flex-control-thumbs li { + width: 25%; + float: left; + margin: 0; +} +.flex-control-thumbs img { + width: 100%; + height: auto; + display: block; + opacity: .7; + cursor: pointer; + -moz-user-select: none; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -ms-transition: all 1s ease; + -o-transition: all 1s ease; + transition: all 1s ease; +} +.flex-control-thumbs img:hover { + opacity: 1; +} +.flex-control-thumbs .flex-active { + opacity: 1; + cursor: default; +} +/* ==================================================================================================================== + * RESPONSIVE + * ====================================================================================================================*/ +@media screen and (max-width: 860px) { + .flex-direction-nav .flex-prev { + opacity: 1; + left: 10px; + } + .flex-direction-nav .flex-next { + opacity: 1; + right: 10px; + } +} diff --git a/demo/js/jquery.flexslider.js b/demo/js/jquery.flexslider.js new file mode 100644 index 00000000..715256b5 --- /dev/null +++ b/demo/js/jquery.flexslider.js @@ -0,0 +1,1195 @@ +/* + * jQuery FlexSlider v2.6.2 + * 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).css('overflow', 'visible') : $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).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, "display": "none"}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing); + slider.slides.eq(target).css({"zIndex": 2, "display": "block"}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); + + } else { + slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1, "display": "none" }); + slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2, "display": "block" }); + 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": "none", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2, "display": "block"}).css({"opacity": 1}); + } else { + slider.slides.css({ "opacity": 0, "display": "none", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2, "display": "block"}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing); + } + } else { + slider.slides.css({ "opacity": 0, "display": "none", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2, "display": "block"}); + } + } + // 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); From 75027a9d1379048f22cbd46072c78684cab4bedd Mon Sep 17 00:00:00 2001 From: Jeffrey Pearce Date: Tue, 6 Sep 2016 17:05:35 +0200 Subject: [PATCH 2/2] Closes #1578 - Rollback fade fixes, due to harsh fade reports. --- README.mdown | 6 +++++- bower.json | 2 +- changelog.txt | 5 ++++- flexslider.css | 2 +- flexslider.less | 2 +- jquery.flexslider-min.js | 4 ++-- jquery.flexslider.js | 22 +++++++++------------- package.json | 2 +- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/README.mdown b/README.mdown index a2d02da0..0d9a846b 100644 --- a/README.mdown +++ b/README.mdown @@ -1,6 +1,6 @@ [![Gitter chat](https://badges.gitter.im/woothemes/FlexSlider.png)](https://gitter.im/woothemes/FlexSlider) -# FlexSlider 2.6.2 +# FlexSlider 2.6.3 http://www.woothemes.com/flexslider/ - Copyright (c) 2015 WooThemes ## Releases @@ -19,6 +19,10 @@ To keep up to date with how FlexSlider's development roadmap looks, please see o ## Updates +** Version 2.6.3 ** + +** Rollback fade fixes, due to harsh fade reports. ** + ** Version 2.6.2 ** ** Minor update to fix issues with varying heights and overflow onto content below the slider. Fixes the visibility of the pagination and the navigation in the "fade" mode. ** diff --git a/bower.json b/bower.json index 6e08a957..58ee72e8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "flexslider", - "version": "2.6.2", + "version": "2.6.3", "homepage": "https://github.com/woothemes/FlexSlider", "authors": [ "WooThemes " diff --git a/changelog.txt b/changelog.txt index 9a7fe594..32b01024 100644 --- a/changelog.txt +++ b/changelog.txt @@ -37,4 +37,7 @@ FLEXSLIDER CHANGELOG 2016.08.18 - Version 2.6.2 * Fixes overflow issue with varying height images. -* Fixes the visibility of the pagination and the navigation in the "fade" mode. \ No newline at end of file +* Fixes the visibility of the pagination and the navigation in the "fade" mode. + +2016.09.06 - Version 2.6.3 +* Rollback fade fixes, due to harsh fade reports. \ No newline at end of file diff --git a/flexslider.css b/flexslider.css index 88cbfb8b..6418b362 100644 --- a/flexslider.css +++ b/flexslider.css @@ -1,5 +1,5 @@ /* - * jQuery FlexSlider v2.6.2 + * jQuery FlexSlider v2.6.3 * http://www.woothemes.com/flexslider/ * * Copyright 2012 WooThemes diff --git a/flexslider.less b/flexslider.less index a1a6b3da..7509ccb9 100644 --- a/flexslider.less +++ b/flexslider.less @@ -1,5 +1,5 @@ /* - * jQuery FlexSlider v2.6.2 + * jQuery FlexSlider v2.6.3 * http://www.woothemes.com/flexslider/ * * Copyright 2012 WooThemes diff --git a/jquery.flexslider-min.js b/jquery.flexslider-min.js index 001a68db..a8c03958 100644 --- a/jquery.flexslider-min.js +++ b/jquery.flexslider-min.js @@ -1,5 +1,5 @@ /* - * jQuery FlexSlider v2.6.2 + * jQuery FlexSlider v2.6.3 * Copyright 2012 WooThemes * Contributing Author: Tyler Smith - */!function($){var e=!0;$.flexslider=function(t,a){var n=$(t);n.vars=$.extend({},$.flexslider.defaults,a);var i=n.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,r=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&n.vars.touch,o="click touchend MSPointerUp keyup",l="",c,d="vertical"===n.vars.direction,u=n.vars.reverse,v=n.vars.itemWidth>0,p="fade"===n.vars.animation,m=""!==n.vars.asNavFor,f={};$.data(t,"flexslider",n),f={init:function(){n.animating=!1,n.currentSlide=parseInt(n.vars.startAt?n.vars.startAt:0,10),isNaN(n.currentSlide)&&(n.currentSlide=0),n.animatingTo=n.currentSlide,n.atEnd=0===n.currentSlide||n.currentSlide===n.last,n.containerSelector=n.vars.selector.substr(0,n.vars.selector.search(" ")),n.slides=$(n.vars.selector,n),n.container=$(n.containerSelector,n),n.count=n.slides.length,n.syncExists=$(n.vars.sync).length>0,"slide"===n.vars.animation&&(n.vars.animation="swing"),n.prop=d?"top":"marginLeft",n.args={},n.manualPause=!1,n.stopped=!1,n.started=!1,n.startTimeout=null,n.transitions=!n.vars.video&&!p&&n.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(void 0!==e.style[t[a]])return n.pfx=t[a].replace("Perspective","").toLowerCase(),n.prop="-"+n.pfx+"-transform",!0;return!1}(),n.ensureAnimationEnd="",""!==n.vars.controlsContainer&&(n.controlsContainer=$(n.vars.controlsContainer).length>0&&$(n.vars.controlsContainer)),""!==n.vars.manualControls&&(n.manualControls=$(n.vars.manualControls).length>0&&$(n.vars.manualControls)),""!==n.vars.customDirectionNav&&(n.customDirectionNav=2===$(n.vars.customDirectionNav).length&&$(n.vars.customDirectionNav)),n.vars.randomize&&(n.slides.sort(function(){return Math.round(Math.random())-.5}),n.container.empty().append(n.slides)),n.doMath(),n.setup("init"),n.vars.controlNav&&f.controlNav.setup(),n.vars.directionNav&&f.directionNav.setup(),n.vars.keyboard&&(1===$(n.containerSelector).length||n.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!n.animating&&(39===t||37===t)){var a=39===t?n.getTarget("next"):37===t?n.getTarget("prev"):!1;n.flexAnimate(a,n.vars.pauseOnAction)}}),n.vars.mousewheel&&n.bind("mousewheel",function(e,t,a,i){e.preventDefault();var s=0>t?n.getTarget("next"):n.getTarget("prev");n.flexAnimate(s,n.vars.pauseOnAction)}),n.vars.pausePlay&&f.pausePlay.setup(),n.vars.slideshow&&n.vars.pauseInvisible&&f.pauseInvisible.init(),n.vars.slideshow&&(n.vars.pauseOnHover&&n.hover(function(){n.manualPlay||n.manualPause||n.pause()},function(){n.manualPause||n.manualPlay||n.stopped||n.play()}),n.vars.pauseInvisible&&f.pauseInvisible.isHidden()||(n.vars.initDelay>0?n.startTimeout=setTimeout(n.play,n.vars.initDelay):n.play())),m&&f.asNav.setup(),r&&n.vars.touch&&f.touch(),(!p||p&&n.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",f.resize),n.find("img").attr("draggable","false"),setTimeout(function(){n.vars.start(n)},200)},asNav:{setup:function(){n.asNav=!0,n.animatingTo=Math.floor(n.currentSlide/n.move),n.currentItem=n.currentSlide,n.slides.removeClass(i+"active-slide").eq(n.currentItem).addClass(i+"active-slide"),s?(t._slider=n,n.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),a=t.index();$(n.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(n.direction=n.currentItem=s&&t.hasClass(i+"active-slide")?n.flexAnimate(n.getTarget("prev"),!0):$(n.vars.asNavFor).data("flexslider").animating||t.hasClass(i+"active-slide")||(n.direction=n.currentItem'),n.pagingCount>1)for(var r=0;r":''+t+"","thumbnails"===n.vars.controlNav&&!0===n.vars.thumbCaptions){var d=s.attr("data-thumbcaption");""!==d&&void 0!==d&&(a+=''+d+"")}n.controlNavScaffold.append("
  5. "+a+"
  6. "),t++}n.controlsContainer?$(n.controlsContainer).append(n.controlNavScaffold):n.append(n.controlNavScaffold),f.controlNav.set(),f.controlNav.active(),n.controlNavScaffold.delegate("a, img",o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(n.direction=a>n.currentSlide?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},setupManual:function(){n.controlNav=n.manualControls,f.controlNav.active(),n.controlNav.bind(o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(a>n.currentSlide?n.direction="next":n.direction="prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===n.vars.controlNav?"img":"a";n.controlNav=$("."+i+"control-nav li "+e,n.controlsContainer?n.controlsContainer:n)},active:function(){n.controlNav.removeClass(i+"active").eq(n.animatingTo).addClass(i+"active")},update:function(e,t){n.pagingCount>1&&"add"===e?n.controlNavScaffold.append($('
  7. '+n.count+"
  8. ")):1===n.pagingCount?n.controlNavScaffold.find("li").remove():n.controlNav.eq(t).closest("li").remove(),f.controlNav.set(),n.pagingCount>1&&n.pagingCount!==n.controlNav.length?n.update(t,e):f.controlNav.active()}},directionNav:{setup:function(){var e=$('");n.customDirectionNav?n.directionNav=n.customDirectionNav:n.controlsContainer?($(n.controlsContainer).append(e),n.directionNav=$("."+i+"direction-nav li a",n.controlsContainer)):(n.append(e),n.directionNav=$("."+i+"direction-nav li a",n)),f.directionNav.update(),n.directionNav.bind(o,function(e){e.preventDefault();var t;""!==l&&l!==e.type||(t=$(this).hasClass(i+"next")?n.getTarget("next"):n.getTarget("prev"),n.flexAnimate(t,n.vars.pauseOnAction)),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";1===n.pagingCount?n.directionNav.addClass(e).attr("tabindex","-1"):n.vars.animationLoop?n.directionNav.removeClass(e).removeAttr("tabindex"):0===n.animatingTo?n.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):n.animatingTo===n.last?n.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):n.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=$('
    ');n.controlsContainer?(n.controlsContainer.append(e),n.pausePlay=$("."+i+"pauseplay a",n.controlsContainer)):(n.append(e),n.pausePlay=$("."+i+"pauseplay a",n)),f.pausePlay.update(n.vars.slideshow?i+"pause":i+"play"),n.pausePlay.bind(o,function(e){e.preventDefault(),""!==l&&l!==e.type||($(this).hasClass(i+"pause")?(n.manualPause=!0,n.manualPlay=!1,n.pause()):(n.manualPause=!1,n.manualPlay=!0,n.play())),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(e){"play"===e?n.pausePlay.removeClass(i+"pause").addClass(i+"play").html(n.vars.playText):n.pausePlay.removeClass(i+"play").addClass(i+"pause").html(n.vars.pauseText)}},touch:function(){function e(e){e.stopPropagation(),n.animating?e.preventDefault():(n.pause(),t._gesture.addPointer(e.pointerId),w=0,c=d?n.h:n.w,f=Number(new Date),l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c)}function a(e){e.stopPropagation();var a=e.target._slider;if(a){var n=-e.translationX,i=-e.translationY;return w+=d?i:n,m=w,y=d?Math.abs(w)500)&&(e.preventDefault(),!p&&a.transitions&&(a.vars.animationLoop||(m=w/(0===a.currentSlide&&0>w||a.currentSlide===a.last&&w>0?Math.abs(w)/c+2:1)),a.setProps(l+m,"setTouch"))))}}function i(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!y&&null!==m){var a=u?-m:m,n=a>0?t.getTarget("next"):t.getTarget("prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?t.flexAnimate(n,t.vars.pauseOnAction):p||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,w=0}}var r,o,l,c,m,f,g,h,S,y=!1,b=0,x=0,w=0;s?(t.style.msTouchAction="none",t._gesture=new MSGesture,t._gesture.target=t,t.addEventListener("MSPointerDown",e,!1),t._slider=n,t.addEventListener("MSGestureChange",a,!1),t.addEventListener("MSGestureEnd",i,!1)):(g=function(e){n.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(n.pause(),c=d?n.h:n.w,f=Number(new Date),b=e.touches[0].pageX,x=e.touches[0].pageY,l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c,r=d?x:b,o=d?b:x,t.addEventListener("touchmove",h,!1),t.addEventListener("touchend",S,!1))},h=function(e){b=e.touches[0].pageX,x=e.touches[0].pageY,m=d?r-x:r-b,y=d?Math.abs(m)t)&&(e.preventDefault(),!p&&n.transitions&&(n.vars.animationLoop||(m/=0===n.currentSlide&&0>m||n.currentSlide===n.last&&m>0?Math.abs(m)/c+2:1),n.setProps(l+m,"setTouch")))},S=function(e){if(t.removeEventListener("touchmove",h,!1),n.animatingTo===n.currentSlide&&!y&&null!==m){var a=u?-m:m,i=a>0?n.getTarget("next"):n.getTarget("prev");n.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?n.flexAnimate(i,n.vars.pauseOnAction):p||n.flexAnimate(n.currentSlide,n.vars.pauseOnAction,!0)}t.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},t.addEventListener("touchstart",g,!1))},resize:function(){!n.animating&&n.is(":visible")&&(v||n.doMath(),p?f.smoothHeight():v?(n.slides.width(n.computedW),n.update(n.pagingCount),n.setProps()):d?(n.viewport.height(n.h),n.setProps(n.h,"setTotal")):(n.vars.smoothHeight&&f.smoothHeight(),n.newSlides.width(n.computedW),n.setProps(n.computedW,"setTotal")))},smoothHeight:function(e){if(!d||p){var t=p?n:n.viewport;e?t.animate({height:n.slides.eq(n.animatingTo).innerHeight()},e).css("overflow","visible"):t.innerHeight(n.slides.eq(n.animatingTo).innerHeight())}},sync:function(e){var t=$(n.vars.sync).data("flexslider"),a=n.animatingTo;switch(e){case"animate":t.flexAnimate(a,n.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=f.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){f.pauseInvisible.isHidden()?n.startTimeout?clearTimeout(n.startTimeout):n.pause():n.started?n.play():n.vars.initDelay>0?setTimeout(n.play,n.vars.initDelay):n.play()})}},isHidden:function(){var e=f.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;tn.currentSlide?"next":"prev"),m&&1===n.pagingCount&&(n.direction=n.currentItemn.limit&&1!==n.visible?n.limit:S):h=0===n.currentSlide&&e===n.count-1&&n.vars.animationLoop&&"next"!==n.direction?u?(n.count+n.cloneOffset)*c:0:n.currentSlide===n.last&&0===e&&n.vars.animationLoop&&"prev"!==n.direction?u?0:(n.count+1)*c:u?(n.count-1-e+n.cloneOffset)*c:(e+n.cloneOffset)*c,n.setProps(h,"",n.vars.animationSpeed),n.transitions?(n.vars.animationLoop&&n.atEnd||(n.animating=!1,n.currentSlide=n.animatingTo),n.container.unbind("webkitTransitionEnd transitionend"),n.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(n.ensureAnimationEnd),n.wrapup(c)}),clearTimeout(n.ensureAnimationEnd),n.ensureAnimationEnd=setTimeout(function(){n.wrapup(c)},n.vars.animationSpeed+100)):n.container.animate(n.args,n.vars.animationSpeed,n.vars.easing,function(){n.wrapup(c)})}n.vars.smoothHeight&&f.smoothHeight(n.vars.animationSpeed)}},n.wrapup=function(e){p||v||(0===n.currentSlide&&n.animatingTo===n.last&&n.vars.animationLoop?n.setProps(e,"jumpEnd"):n.currentSlide===n.last&&0===n.animatingTo&&n.vars.animationLoop&&n.setProps(e,"jumpStart")),n.animating=!1,n.currentSlide=n.animatingTo,n.vars.after(n)},n.animateSlides=function(){!n.animating&&e&&n.flexAnimate(n.getTarget("next"))},n.pause=function(){clearInterval(n.animatedSlides),n.animatedSlides=null,n.playing=!1,n.vars.pausePlay&&f.pausePlay.update("play"),n.syncExists&&f.sync("pause")},n.play=function(){n.playing&&clearInterval(n.animatedSlides),n.animatedSlides=n.animatedSlides||setInterval(n.animateSlides,n.vars.slideshowSpeed),n.started=n.playing=!0,n.vars.pausePlay&&f.pausePlay.update("pause"),n.syncExists&&f.sync("play")},n.stop=function(){n.pause(),n.stopped=!0},n.canAdvance=function(e,t){var a=m?n.pagingCount-1:n.last;return t?!0:m&&n.currentItem===n.count-1&&0===e&&"prev"===n.direction?!0:m&&0===n.currentItem&&e===n.pagingCount-1&&"next"!==n.direction?!1:e!==n.currentSlide||m?n.vars.animationLoop?!0:n.atEnd&&0===n.currentSlide&&e===a&&"next"!==n.direction?!1:!n.atEnd||n.currentSlide!==a||0!==e||"next"!==n.direction:!1},n.getTarget=function(e){return n.direction=e,"next"===e?n.currentSlide===n.last?0:n.currentSlide+1:0===n.currentSlide?n.last:n.currentSlide-1},n.setProps=function(e,t,a){var i=function(){var a=e?e:(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo,i=function(){if(v)return"setTouch"===t?e:u&&n.animatingTo===n.last?0:u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:n.animatingTo===n.last?n.limit:a;switch(t){case"setTotal":return u?(n.count-1-n.currentSlide+n.cloneOffset)*e:(n.currentSlide+n.cloneOffset)*e;case"setTouch":return u?e:e;case"jumpEnd":return u?e:n.count*e;case"jumpStart":return u?n.count*e:e;default:return e}}();return-1*i+"px"}();n.transitions&&(i=d?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",a=void 0!==a?a/1e3+"s":"0s",n.container.css("-"+n.pfx+"-transition-duration",a),n.container.css("transition-duration",a)),n.args[n.prop]=i,(n.transitions||void 0===a)&&n.container.css(n.args),n.container.css("transform",i)},n.setup=function(e){if(p)n.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(r?n.slides.css({opacity:0,display:"none",webkitTransition:"opacity "+n.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(n.currentSlide).css({opacity:1,zIndex:2,display:"block"}):0==n.vars.fadeFirstSlide?n.slides.css({opacity:0,display:"none",zIndex:1}).eq(n.currentSlide).css({zIndex:2,display:"block"}).css({opacity:1}):n.slides.css({opacity:0,display:"none",zIndex:1}).eq(n.currentSlide).css({zIndex:2,display:"block"}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing)),n.vars.smoothHeight&&f.smoothHeight();else{var t,a;"init"===e&&(n.viewport=$('
    ').css({overflow:"hidden",position:"relative"}).appendTo(n).append(n.container),n.cloneCount=0,n.cloneOffset=0,u&&(a=$.makeArray(n.slides).reverse(),n.slides=$(a),n.container.empty().append(n.slides))),n.vars.animationLoop&&!v&&(n.cloneCount=2,n.cloneOffset=1,"init"!==e&&n.container.find(".clone").remove(),n.container.append(f.uniqueID(n.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(f.uniqueID(n.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),n.newSlides=$(n.vars.selector,n),t=u?n.count-1-n.currentSlide+n.cloneOffset:n.currentSlide+n.cloneOffset,d&&!v?(n.container.height(200*(n.count+n.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){n.newSlides.css({display:"block"}),n.doMath(),n.viewport.height(n.h),n.setProps(t*n.h,"init")},"init"===e?100:0)):(n.container.width(200*(n.count+n.cloneCount)+"%"),n.setProps(t*n.computedW,"init"),setTimeout(function(){n.doMath(),n.newSlides.css({width:n.computedW,marginRight:n.computedM,"float":"left",display:"block"}),n.vars.smoothHeight&&f.smoothHeight()},"init"===e?100:0))}v||n.slides.removeClass(i+"active-slide").eq(n.currentSlide).addClass(i+"active-slide"),n.vars.init(n)},n.doMath=function(){var e=n.slides.first(),t=n.vars.itemMargin,a=n.vars.minItems,i=n.vars.maxItems;n.w=void 0===n.viewport?n.width():n.viewport.width(),n.h=e.height(),n.boxPadding=e.outerWidth()-e.width(),v?(n.itemT=n.vars.itemWidth+t,n.itemM=t,n.minW=a?a*n.itemT:n.w,n.maxW=i?i*n.itemT-t:n.w,n.itemW=n.minW>n.w?(n.w-t*(a-1))/a:n.maxWn.w?n.w:n.vars.itemWidth,n.visible=Math.floor(n.w/n.itemW),n.move=n.vars.move>0&&n.vars.moven.w?n.itemW*(n.count-1)+t*(n.count-1):(n.itemW+t)*n.count-n.w-t):(n.itemW=n.w,n.itemM=t,n.pagingCount=n.count,n.last=n.count-1),n.computedW=n.itemW-n.boxPadding,n.computedM=n.itemM},n.update=function(e,t){n.doMath(),v||(en.controlNav.length?f.controlNav.update("add"):("remove"===t&&!v||n.pagingCountn.last&&(n.currentSlide-=1,n.animatingTo-=1),f.controlNav.update("remove",n.last))),n.vars.directionNav&&f.directionNav.update()},n.addSlide=function(e,t){var a=$(e);n.count+=1,n.last=n.count-1,d&&u?void 0!==t?n.slides.eq(n.count-t).after(a):n.container.prepend(a):void 0!==t?n.slides.eq(t).before(a):n.container.append(a),n.update(t,"add"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.added(n)},n.removeSlide=function(e){var t=isNaN(e)?n.slides.index($(e)):e;n.count-=1,n.last=n.count-1,isNaN(e)?$(e,n.slides).remove():d&&u?n.slides.eq(n.last).remove():n.slides.eq(e).remove(),n.doMath(),n.update(t,"remove"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.removed(n)},f.init()},$(window).blur(function(t){e=!1}).focus(function(t){e=!0}),$.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,fadeFirstSlide:!0,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:"",customDirectionNav:"",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(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!1||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery); \ No newline at end of file + */!function($){var e=!0;$.flexslider=function(t,a){var n=$(t);n.vars=$.extend({},$.flexslider.defaults,a);var i=n.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,r=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&n.vars.touch,o="click touchend MSPointerUp keyup",l="",c,d="vertical"===n.vars.direction,u=n.vars.reverse,v=n.vars.itemWidth>0,p="fade"===n.vars.animation,m=""!==n.vars.asNavFor,f={};$.data(t,"flexslider",n),f={init:function(){n.animating=!1,n.currentSlide=parseInt(n.vars.startAt?n.vars.startAt:0,10),isNaN(n.currentSlide)&&(n.currentSlide=0),n.animatingTo=n.currentSlide,n.atEnd=0===n.currentSlide||n.currentSlide===n.last,n.containerSelector=n.vars.selector.substr(0,n.vars.selector.search(" ")),n.slides=$(n.vars.selector,n),n.container=$(n.containerSelector,n),n.count=n.slides.length,n.syncExists=$(n.vars.sync).length>0,"slide"===n.vars.animation&&(n.vars.animation="swing"),n.prop=d?"top":"marginLeft",n.args={},n.manualPause=!1,n.stopped=!1,n.started=!1,n.startTimeout=null,n.transitions=!n.vars.video&&!p&&n.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(void 0!==e.style[t[a]])return n.pfx=t[a].replace("Perspective","").toLowerCase(),n.prop="-"+n.pfx+"-transform",!0;return!1}(),n.ensureAnimationEnd="",""!==n.vars.controlsContainer&&(n.controlsContainer=$(n.vars.controlsContainer).length>0&&$(n.vars.controlsContainer)),""!==n.vars.manualControls&&(n.manualControls=$(n.vars.manualControls).length>0&&$(n.vars.manualControls)),""!==n.vars.customDirectionNav&&(n.customDirectionNav=2===$(n.vars.customDirectionNav).length&&$(n.vars.customDirectionNav)),n.vars.randomize&&(n.slides.sort(function(){return Math.round(Math.random())-.5}),n.container.empty().append(n.slides)),n.doMath(),n.setup("init"),n.vars.controlNav&&f.controlNav.setup(),n.vars.directionNav&&f.directionNav.setup(),n.vars.keyboard&&(1===$(n.containerSelector).length||n.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!n.animating&&(39===t||37===t)){var a=39===t?n.getTarget("next"):37===t?n.getTarget("prev"):!1;n.flexAnimate(a,n.vars.pauseOnAction)}}),n.vars.mousewheel&&n.bind("mousewheel",function(e,t,a,i){e.preventDefault();var s=0>t?n.getTarget("next"):n.getTarget("prev");n.flexAnimate(s,n.vars.pauseOnAction)}),n.vars.pausePlay&&f.pausePlay.setup(),n.vars.slideshow&&n.vars.pauseInvisible&&f.pauseInvisible.init(),n.vars.slideshow&&(n.vars.pauseOnHover&&n.hover(function(){n.manualPlay||n.manualPause||n.pause()},function(){n.manualPause||n.manualPlay||n.stopped||n.play()}),n.vars.pauseInvisible&&f.pauseInvisible.isHidden()||(n.vars.initDelay>0?n.startTimeout=setTimeout(n.play,n.vars.initDelay):n.play())),m&&f.asNav.setup(),r&&n.vars.touch&&f.touch(),(!p||p&&n.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",f.resize),n.find("img").attr("draggable","false"),setTimeout(function(){n.vars.start(n)},200)},asNav:{setup:function(){n.asNav=!0,n.animatingTo=Math.floor(n.currentSlide/n.move),n.currentItem=n.currentSlide,n.slides.removeClass(i+"active-slide").eq(n.currentItem).addClass(i+"active-slide"),s?(t._slider=n,n.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),a=t.index();$(n.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(n.direction=n.currentItem=s&&t.hasClass(i+"active-slide")?n.flexAnimate(n.getTarget("prev"),!0):$(n.vars.asNavFor).data("flexslider").animating||t.hasClass(i+"active-slide")||(n.direction=n.currentItem'),n.pagingCount>1)for(var r=0;r":''+t+"","thumbnails"===n.vars.controlNav&&!0===n.vars.thumbCaptions){var d=s.attr("data-thumbcaption");""!==d&&void 0!==d&&(a+=''+d+"")}n.controlNavScaffold.append("
  9. "+a+"
  10. "),t++}n.controlsContainer?$(n.controlsContainer).append(n.controlNavScaffold):n.append(n.controlNavScaffold),f.controlNav.set(),f.controlNav.active(),n.controlNavScaffold.delegate("a, img",o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(n.direction=a>n.currentSlide?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},setupManual:function(){n.controlNav=n.manualControls,f.controlNav.active(),n.controlNav.bind(o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(a>n.currentSlide?n.direction="next":n.direction="prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===n.vars.controlNav?"img":"a";n.controlNav=$("."+i+"control-nav li "+e,n.controlsContainer?n.controlsContainer:n)},active:function(){n.controlNav.removeClass(i+"active").eq(n.animatingTo).addClass(i+"active")},update:function(e,t){n.pagingCount>1&&"add"===e?n.controlNavScaffold.append($('
  11. '+n.count+"
  12. ")):1===n.pagingCount?n.controlNavScaffold.find("li").remove():n.controlNav.eq(t).closest("li").remove(),f.controlNav.set(),n.pagingCount>1&&n.pagingCount!==n.controlNav.length?n.update(t,e):f.controlNav.active()}},directionNav:{setup:function(){var e=$('");n.customDirectionNav?n.directionNav=n.customDirectionNav:n.controlsContainer?($(n.controlsContainer).append(e),n.directionNav=$("."+i+"direction-nav li a",n.controlsContainer)):(n.append(e),n.directionNav=$("."+i+"direction-nav li a",n)),f.directionNav.update(),n.directionNav.bind(o,function(e){e.preventDefault();var t;""!==l&&l!==e.type||(t=$(this).hasClass(i+"next")?n.getTarget("next"):n.getTarget("prev"),n.flexAnimate(t,n.vars.pauseOnAction)),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";1===n.pagingCount?n.directionNav.addClass(e).attr("tabindex","-1"):n.vars.animationLoop?n.directionNav.removeClass(e).removeAttr("tabindex"):0===n.animatingTo?n.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):n.animatingTo===n.last?n.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):n.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=$('
    ');n.controlsContainer?(n.controlsContainer.append(e),n.pausePlay=$("."+i+"pauseplay a",n.controlsContainer)):(n.append(e),n.pausePlay=$("."+i+"pauseplay a",n)),f.pausePlay.update(n.vars.slideshow?i+"pause":i+"play"),n.pausePlay.bind(o,function(e){e.preventDefault(),""!==l&&l!==e.type||($(this).hasClass(i+"pause")?(n.manualPause=!0,n.manualPlay=!1,n.pause()):(n.manualPause=!1,n.manualPlay=!0,n.play())),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(e){"play"===e?n.pausePlay.removeClass(i+"pause").addClass(i+"play").html(n.vars.playText):n.pausePlay.removeClass(i+"play").addClass(i+"pause").html(n.vars.pauseText)}},touch:function(){function e(e){e.stopPropagation(),n.animating?e.preventDefault():(n.pause(),t._gesture.addPointer(e.pointerId),T=0,c=d?n.h:n.w,f=Number(new Date),l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c)}function a(e){e.stopPropagation();var a=e.target._slider;if(a){var n=-e.translationX,i=-e.translationY;return T+=d?i:n,m=T,y=d?Math.abs(T)500)&&(e.preventDefault(),!p&&a.transitions&&(a.vars.animationLoop||(m=T/(0===a.currentSlide&&0>T||a.currentSlide===a.last&&T>0?Math.abs(T)/c+2:1)),a.setProps(l+m,"setTouch"))))}}function i(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!y&&null!==m){var a=u?-m:m,n=a>0?t.getTarget("next"):t.getTarget("prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?t.flexAnimate(n,t.vars.pauseOnAction):p||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,T=0}}var r,o,l,c,m,f,g,h,S,y=!1,x=0,b=0,T=0;s?(t.style.msTouchAction="none",t._gesture=new MSGesture,t._gesture.target=t,t.addEventListener("MSPointerDown",e,!1),t._slider=n,t.addEventListener("MSGestureChange",a,!1),t.addEventListener("MSGestureEnd",i,!1)):(g=function(e){n.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(n.pause(),c=d?n.h:n.w,f=Number(new Date),x=e.touches[0].pageX,b=e.touches[0].pageY,l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c,r=d?b:x,o=d?x:b,t.addEventListener("touchmove",h,!1),t.addEventListener("touchend",S,!1))},h=function(e){x=e.touches[0].pageX,b=e.touches[0].pageY,m=d?r-b:r-x,y=d?Math.abs(m)t)&&(e.preventDefault(),!p&&n.transitions&&(n.vars.animationLoop||(m/=0===n.currentSlide&&0>m||n.currentSlide===n.last&&m>0?Math.abs(m)/c+2:1),n.setProps(l+m,"setTouch")))},S=function(e){if(t.removeEventListener("touchmove",h,!1),n.animatingTo===n.currentSlide&&!y&&null!==m){var a=u?-m:m,i=a>0?n.getTarget("next"):n.getTarget("prev");n.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?n.flexAnimate(i,n.vars.pauseOnAction):p||n.flexAnimate(n.currentSlide,n.vars.pauseOnAction,!0)}t.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},t.addEventListener("touchstart",g,!1))},resize:function(){!n.animating&&n.is(":visible")&&(v||n.doMath(),p?f.smoothHeight():v?(n.slides.width(n.computedW),n.update(n.pagingCount),n.setProps()):d?(n.viewport.height(n.h),n.setProps(n.h,"setTotal")):(n.vars.smoothHeight&&f.smoothHeight(),n.newSlides.width(n.computedW),n.setProps(n.computedW,"setTotal")))},smoothHeight:function(e){if(!d||p){var t=p?n:n.viewport;e?t.animate({height:n.slides.eq(n.animatingTo).innerHeight()},e):t.innerHeight(n.slides.eq(n.animatingTo).innerHeight())}},sync:function(e){var t=$(n.vars.sync).data("flexslider"),a=n.animatingTo;switch(e){case"animate":t.flexAnimate(a,n.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=f.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){f.pauseInvisible.isHidden()?n.startTimeout?clearTimeout(n.startTimeout):n.pause():n.started?n.play():n.vars.initDelay>0?setTimeout(n.play,n.vars.initDelay):n.play()})}},isHidden:function(){var e=f.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;tn.currentSlide?"next":"prev"),m&&1===n.pagingCount&&(n.direction=n.currentItemn.limit&&1!==n.visible?n.limit:S):h=0===n.currentSlide&&e===n.count-1&&n.vars.animationLoop&&"next"!==n.direction?u?(n.count+n.cloneOffset)*c:0:n.currentSlide===n.last&&0===e&&n.vars.animationLoop&&"prev"!==n.direction?u?0:(n.count+1)*c:u?(n.count-1-e+n.cloneOffset)*c:(e+n.cloneOffset)*c,n.setProps(h,"",n.vars.animationSpeed),n.transitions?(n.vars.animationLoop&&n.atEnd||(n.animating=!1,n.currentSlide=n.animatingTo),n.container.unbind("webkitTransitionEnd transitionend"),n.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(n.ensureAnimationEnd),n.wrapup(c)}),clearTimeout(n.ensureAnimationEnd),n.ensureAnimationEnd=setTimeout(function(){n.wrapup(c)},n.vars.animationSpeed+100)):n.container.animate(n.args,n.vars.animationSpeed,n.vars.easing,function(){n.wrapup(c)})}n.vars.smoothHeight&&f.smoothHeight(n.vars.animationSpeed)}},n.wrapup=function(e){p||v||(0===n.currentSlide&&n.animatingTo===n.last&&n.vars.animationLoop?n.setProps(e,"jumpEnd"):n.currentSlide===n.last&&0===n.animatingTo&&n.vars.animationLoop&&n.setProps(e,"jumpStart")),n.animating=!1,n.currentSlide=n.animatingTo,n.vars.after(n)},n.animateSlides=function(){!n.animating&&e&&n.flexAnimate(n.getTarget("next"))},n.pause=function(){clearInterval(n.animatedSlides),n.animatedSlides=null,n.playing=!1,n.vars.pausePlay&&f.pausePlay.update("play"),n.syncExists&&f.sync("pause")},n.play=function(){n.playing&&clearInterval(n.animatedSlides),n.animatedSlides=n.animatedSlides||setInterval(n.animateSlides,n.vars.slideshowSpeed),n.started=n.playing=!0,n.vars.pausePlay&&f.pausePlay.update("pause"),n.syncExists&&f.sync("play")},n.stop=function(){n.pause(),n.stopped=!0},n.canAdvance=function(e,t){var a=m?n.pagingCount-1:n.last;return t?!0:m&&n.currentItem===n.count-1&&0===e&&"prev"===n.direction?!0:m&&0===n.currentItem&&e===n.pagingCount-1&&"next"!==n.direction?!1:e!==n.currentSlide||m?n.vars.animationLoop?!0:n.atEnd&&0===n.currentSlide&&e===a&&"next"!==n.direction?!1:!n.atEnd||n.currentSlide!==a||0!==e||"next"!==n.direction:!1},n.getTarget=function(e){return n.direction=e,"next"===e?n.currentSlide===n.last?0:n.currentSlide+1:0===n.currentSlide?n.last:n.currentSlide-1},n.setProps=function(e,t,a){var i=function(){var a=e?e:(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo,i=function(){if(v)return"setTouch"===t?e:u&&n.animatingTo===n.last?0:u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:n.animatingTo===n.last?n.limit:a;switch(t){case"setTotal":return u?(n.count-1-n.currentSlide+n.cloneOffset)*e:(n.currentSlide+n.cloneOffset)*e;case"setTouch":return u?e:e;case"jumpEnd":return u?e:n.count*e;case"jumpStart":return u?n.count*e:e;default:return e}}();return-1*i+"px"}();n.transitions&&(i=d?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",a=void 0!==a?a/1e3+"s":"0s",n.container.css("-"+n.pfx+"-transition-duration",a),n.container.css("transition-duration",a)),n.args[n.prop]=i,(n.transitions||void 0===a)&&n.container.css(n.args),n.container.css("transform",i)},n.setup=function(e){if(p)n.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(r?n.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+n.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(n.currentSlide).css({opacity:1,zIndex:2}):0==n.vars.fadeFirstSlide?n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).css({opacity:1}):n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing)),n.vars.smoothHeight&&f.smoothHeight();else{var t,a;"init"===e&&(n.viewport=$('
    ').css({overflow:"hidden",position:"relative"}).appendTo(n).append(n.container),n.cloneCount=0,n.cloneOffset=0,u&&(a=$.makeArray(n.slides).reverse(),n.slides=$(a),n.container.empty().append(n.slides))),n.vars.animationLoop&&!v&&(n.cloneCount=2,n.cloneOffset=1,"init"!==e&&n.container.find(".clone").remove(),n.container.append(f.uniqueID(n.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(f.uniqueID(n.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),n.newSlides=$(n.vars.selector,n),t=u?n.count-1-n.currentSlide+n.cloneOffset:n.currentSlide+n.cloneOffset,d&&!v?(n.container.height(200*(n.count+n.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){n.newSlides.css({display:"block"}),n.doMath(),n.viewport.height(n.h),n.setProps(t*n.h,"init")},"init"===e?100:0)):(n.container.width(200*(n.count+n.cloneCount)+"%"),n.setProps(t*n.computedW,"init"),setTimeout(function(){n.doMath(),n.newSlides.css({width:n.computedW,marginRight:n.computedM,"float":"left",display:"block"}),n.vars.smoothHeight&&f.smoothHeight()},"init"===e?100:0))}v||n.slides.removeClass(i+"active-slide").eq(n.currentSlide).addClass(i+"active-slide"),n.vars.init(n)},n.doMath=function(){var e=n.slides.first(),t=n.vars.itemMargin,a=n.vars.minItems,i=n.vars.maxItems;n.w=void 0===n.viewport?n.width():n.viewport.width(),n.h=e.height(),n.boxPadding=e.outerWidth()-e.width(),v?(n.itemT=n.vars.itemWidth+t,n.itemM=t,n.minW=a?a*n.itemT:n.w,n.maxW=i?i*n.itemT-t:n.w,n.itemW=n.minW>n.w?(n.w-t*(a-1))/a:n.maxWn.w?n.w:n.vars.itemWidth,n.visible=Math.floor(n.w/n.itemW),n.move=n.vars.move>0&&n.vars.moven.w?n.itemW*(n.count-1)+t*(n.count-1):(n.itemW+t)*n.count-n.w-t):(n.itemW=n.w,n.itemM=t,n.pagingCount=n.count,n.last=n.count-1),n.computedW=n.itemW-n.boxPadding,n.computedM=n.itemM},n.update=function(e,t){n.doMath(),v||(en.controlNav.length?f.controlNav.update("add"):("remove"===t&&!v||n.pagingCountn.last&&(n.currentSlide-=1,n.animatingTo-=1),f.controlNav.update("remove",n.last))),n.vars.directionNav&&f.directionNav.update()},n.addSlide=function(e,t){var a=$(e);n.count+=1,n.last=n.count-1,d&&u?void 0!==t?n.slides.eq(n.count-t).after(a):n.container.prepend(a):void 0!==t?n.slides.eq(t).before(a):n.container.append(a),n.update(t,"add"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.added(n)},n.removeSlide=function(e){var t=isNaN(e)?n.slides.index($(e)):e;n.count-=1,n.last=n.count-1,isNaN(e)?$(e,n.slides).remove():d&&u?n.slides.eq(n.last).remove():n.slides.eq(e).remove(),n.doMath(),n.update(t,"remove"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.removed(n)},f.init()},$(window).blur(function(t){e=!1}).focus(function(t){e=!0}),$.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,fadeFirstSlide:!0,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:"",customDirectionNav:"",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(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!1||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery); \ No newline at end of file diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 715256b5..84e67450 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -1,5 +1,5 @@ /* - * jQuery FlexSlider v2.6.2 + * jQuery FlexSlider v2.6.3 * Copyright 2012 WooThemes * Contributing Author: Tyler Smith */ @@ -592,7 +592,7 @@ smoothHeight: function(dur) { if (!vertical || fade) { var $obj = (fade) ? slider : slider.viewport; - (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).innerHeight()}, dur).css('overflow', 'visible') : $obj.innerHeight(slider.slides.eq(slider.animatingTo).innerHeight()); + (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).innerHeight()}, dur) : $obj.innerHeight(slider.slides.eq(slider.animatingTo).innerHeight()); } }, sync: function(action) { @@ -776,15 +776,11 @@ } } 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, "display": "none"}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing); - slider.slides.eq(target).css({"zIndex": 2, "display": "block"}).animate({"opacity": 1}, 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, "display": "none" }); - slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2, "display": "block" }); + slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 }); + slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 }); slider.wrapup(dimension); } } @@ -948,12 +944,12 @@ 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": "none", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2, "display": "block"}).css({"opacity": 1}); + 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": "none", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2, "display": "block"}).animate({"opacity": 1},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": "none", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2, "display": "block"}); + 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: diff --git a/package.json b/package.json index 39da4099..dbaebaaa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flexslider", - "version": "2.6.2", + "version": "2.6.3", "description": "An awesome, fully responsive jQuery slider toolkit.", "main": "jquery.flexslider.js", "scripts": {