diff --git a/assets/bxSlider/jquery.bxslider.js b/assets/bxSlider/jquery.bxslider.js index 67ac4d8..55d78bd 100644 --- a/assets/bxSlider/jquery.bxslider.js +++ b/assets/bxSlider/jquery.bxslider.js @@ -1,6 +1,7 @@ /** - * bxSlider v4.2.12 - * Copyright 2013-2015 Steven Wanderski + * bxSlider v4.2.1d + * Copyright 2013-2017 Steven Wanderski + * fix https://github.com/stevenwanderski/bxslider-4/issues/1240#issuecomment-482294169 * Written while drinking Belgian ales and listening to jazz * Licensed under MIT (http://opensource.org/licenses/MIT) */ @@ -88,7 +89,8 @@ onSlideAfter: function() { return true; }, onSlideNext: function() { return true; }, onSlidePrev: function() { return true; }, - onSliderResize: function() { return true; } + onSliderResize: function() { return true; }, + onAutoChange: function() { return true; } //calls when auto slides starts and stops }; $.fn.bxSlider = function(options) { @@ -107,11 +109,11 @@ // create a namespace to be used throughout the plugin var slider = {}, - // set a reference to our slider element - el = this, - // get the original window dimens (thanks a lot IE) - windowWidth = $(window).width(), - windowHeight = $(window).height(); + // set a reference to our slider element + el = this, + // get the original window dimens (thanks a lot IE) + windowWidth = $(window).width(), + windowHeight = $(window).height(); // Return if slider is already initialized if ($(el).data('bxSlider')) { return; } @@ -142,7 +144,7 @@ // store active slide information slider.active = { index: slider.settings.startSlide }; // store if the slider is in carousel mode (displaying / moving multiple slides) - slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1 ? true : false; + slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1; // if carousel, force preloadImages = 'all' if (slider.carousel) { slider.settings.preloadImages = 'all'; } // calculate the min / max width thresholds based on min / max number of slides @@ -161,8 +163,8 @@ slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function() { // create our test div element var div = document.createElement('div'), - // css transition properties - props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; + // css transition properties + props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; // test for each property for (var i = 0; i < props.length; i++) { if (div.style[props[i]] !== undefined) { @@ -212,7 +214,7 @@ // if using CSS, add the easing property if (slider.usingCSS && slider.settings.easing) { el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing); - // if not using CSS and no easing value was supplied, use the default JS animation easing (swing) + // if not using CSS and no easing value was supplied, use the default JS animation easing (swing) } else if (!slider.settings.easing) { slider.settings.easing = 'swing'; } @@ -227,7 +229,8 @@ }); // apply css to all slider children slider.children.css({ - float: slider.settings.mode === 'horizontal' ? 'left' : 'none', + // the float attribute is a reserved word in compressors like YUI compressor and need to be quoted #48 + 'float': slider.settings.mode === 'horizontal' ? 'left' : 'none', listStyle: 'none', position: 'relative' }); @@ -254,7 +257,13 @@ slider.active.last = slider.settings.startSlide === getPagerQty() - 1; // if video is true, set up the fitVids plugin if (slider.settings.video) { el.fitVids(); } - if (slider.settings.preloadImages === 'all' || slider.settings.ticker) { preloadSelector = slider.children; } + //preloadImages + if (slider.settings.preloadImages === 'none') { + preloadSelector = null; + } + else if (slider.settings.preloadImages === 'all' || slider.settings.ticker) { + preloadSelector = slider.children; + } // only check for control addition if not in "ticker" mode if (!slider.settings.ticker) { // if controls are requested, add them @@ -265,16 +274,20 @@ if (slider.settings.pager) { appendPager(); } // if any control option is requested, add the controls wrapper if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); } - // if ticker mode, do not allow a pager + // if ticker mode, do not allow a pager } else { slider.settings.pager = false; } - loadElements(preloadSelector, start); + if (preloadSelector === null) { + start(); + } else { + loadElements(preloadSelector, start); + } }; var loadElements = function(selector, callback) { var total = selector.find('img:not([src=""]), iframe').length, - count = 0; + count = 0; if (total === 0) { callback(); return; @@ -283,7 +296,7 @@ $(this).one('load error', function() { if (++count === total) { callback(); } }).each(function() { - if (this.complete) { $(this).trigger('load'); } + if (this.complete || this.src == '') { $(this).trigger('load'); } }); }); }; @@ -295,8 +308,8 @@ // if infinite loop, prepare additional slides if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker) { var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides, - sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone'), - slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone'); + sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone'), + slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone'); if (slider.settings.ariaHidden) { sliceAppend.attr('aria-hidden', true); slicePrepend.attr('aria-hidden', true); @@ -317,8 +330,8 @@ slider.settings.onSliderLoad.call(el, slider.active.index); // slider has been fully initialized slider.initialized = true; - // bind the resize call to the window - if (slider.settings.responsive) { $(window).bind('resize', resizeWindow); } + // add the resize call to the window + if (slider.settings.responsive) { $(window).on('resize', resizeWindow); } // if auto is true and has more than 1 page, start the show if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); } // if ticker is true, start the ticker @@ -349,7 +362,7 @@ // if not carousel, return the single active child if (!slider.carousel) { children = slider.children.eq(slider.active.index); - // if carousel, return a slice of children + // if carousel, return a slice of children } else { // get the individual slide index var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy(); @@ -375,7 +388,7 @@ if (slider.settings.slideMargin > 0) { height += slider.settings.slideMargin * (slider.settings.minSlides - 1); } - // if not "vertical" mode, calculate the max height of the children + // if not "vertical" mode, calculate the max height of the children } else { height = Math.max.apply(Math, children.map(function() { return $(this).outerHeight(false); @@ -384,7 +397,7 @@ if (slider.viewport.css('box-sizing') === 'border-box') { height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) + - parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width')); + parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width')); } else if (slider.viewport.css('box-sizing') === 'padding-box') { height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')); } @@ -412,13 +425,13 @@ */ var getSlideWidth = function() { var newElWidth = slider.settings.slideWidth, // start with any user-supplied slide width - wrapWidth = slider.viewport.width(); // get the current viewport width + wrapWidth = slider.viewport.width(); // get the current viewport width // if slide width was not supplied, or is larger than the viewport use the viewport width if (slider.settings.slideWidth === 0 || - (slider.settings.slideWidth > wrapWidth && !slider.carousel) || - slider.settings.mode === 'vertical') { + (slider.settings.slideWidth > wrapWidth && !slider.carousel) || + slider.settings.mode === 'vertical') { newElWidth = wrapWidth; - // if carousel, use the thresholds to determine the width + // if carousel, use the thresholds to determine the width } else if (slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal') { if (wrapWidth > slider.maxThreshold) { return newElWidth; @@ -436,21 +449,21 @@ */ var getNumberSlidesShowing = function() { var slidesShowing = 1, - childWidth = null; + childWidth = null; if (slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0) { // if viewport is smaller than minThreshold, return minSlides if (slider.viewport.width() < slider.minThreshold) { slidesShowing = slider.settings.minSlides; - // if viewport is larger than maxThreshold, return maxSlides + // if viewport is larger than maxThreshold, return maxSlides } else if (slider.viewport.width() > slider.maxThreshold) { slidesShowing = slider.settings.maxSlides; - // if viewport is between min / max thresholds, divide viewport width by first child width + // if viewport is between min / max thresholds, divide viewport width by first child width } else { childWidth = slider.children.first().width() + slider.settings.slideMargin; slidesShowing = Math.floor((slider.viewport.width() + - slider.settings.slideMargin) / childWidth); + slider.settings.slideMargin) / childWidth) || 1; } - // if "vertical" mode, slides showing will always be minSlides + // if "vertical" mode, slides showing will always be minSlides } else if (slider.settings.mode === 'vertical') { slidesShowing = slider.settings.minSlides; } @@ -462,8 +475,8 @@ */ var getPagerQty = function() { var pagerQty = 0, - breakPoint = 0, - counter = 0; + breakPoint = 0, + counter = 0; // if moveSlides is specified by the user if (slider.settings.moveSlides > 0) { if (slider.settings.infiniteLoop) { @@ -475,8 +488,9 @@ breakPoint = counter + getNumberSlidesShowing(); counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing(); } + return counter; } - // if moveSlides is 0 (auto) divide children length by sides showing, then round up + // if moveSlides is 0 (auto) divide children length by sides showing, then round up } else { pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing()); } @@ -515,7 +529,7 @@ // set the top position setPositionProperty(-position.top, 'reset', 0); } - // if not last slide + // if not last slide } else { // get the position of the first showing slide position = slider.children.eq(slider.active.index * getMoveBy()).position(); @@ -557,12 +571,12 @@ // set the property value el.css(slider.animProp, propValue); if (duration !== 0) { - // bind a callback method - executes when CSS transition completes - el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { + // add a callback method - executes when CSS transition completes + el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { //make sure it's the correct one if (!$(e.target).is(el)) { return; } - // unbind the callback - el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); + // remove the callback + el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); updateAfterSlideTransition(); }); } else { //duration = 0 @@ -575,11 +589,11 @@ el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear'); el.css(slider.animProp, propValue); if (duration !== 0) { - el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { + el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { //make sure it's the correct one if (!$(e.target).is(el)) { return; } - // unbind the callback - el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); + // remove the callback + el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); // reset the position setPositionProperty(params.resetValue, 'reset', 0); // start the loop again @@ -590,7 +604,7 @@ tickerLoop(); } } - // use JS animate + // use JS animate } else { animateObj = {}; animateObj[slider.animProp] = value; @@ -615,8 +629,8 @@ */ var populatePager = function() { var pagerHtml = '', - linkContent = '', - pagerQty = getPagerQty(); + linkContent = '', + pagerQty = getPagerQty(); // loop through each pager item for (var i = 0; i < pagerQty; i++) { linkContent = ''; @@ -646,7 +660,7 @@ // if a pager selector was supplied, populate it with the pager if (slider.settings.pagerSelector) { $(slider.settings.pagerSelector).html(slider.pagerEl); - // if no pager selector was supplied, add it after the wrapper + // if no pager selector was supplied, add it after the wrapper } else { slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl); } @@ -665,9 +679,9 @@ var appendControls = function() { slider.controls.next = $('' + slider.settings.nextText + ''); slider.controls.prev = $('' + slider.settings.prevText + ''); - // bind click actions to the controls - slider.controls.next.bind('click touchend', clickNextBind); - slider.controls.prev.bind('click touchend', clickPrevBind); + // add click actions to the controls + slider.controls.next.on('click touchend', clickNextBind); + slider.controls.prev.on('click touchend', clickPrevBind); // if nextSelector was supplied, populate it if (slider.settings.nextSelector) { $(slider.settings.nextSelector).append(slider.controls.next); @@ -695,20 +709,20 @@ slider.controls.stop = $('
' + slider.settings.stopText + '
'); // add the controls to the DOM slider.controls.autoEl = $('
'); - // bind click actions to the controls + // on click actions to the controls slider.controls.autoEl.on('click', '.bx-start', clickStartBind); slider.controls.autoEl.on('click', '.bx-stop', clickStopBind); // if autoControlsCombine, insert only the "start" control if (slider.settings.autoControlsCombine) { slider.controls.autoEl.append(slider.controls.start); - // if autoControlsCombine is false, insert both controls + // if autoControlsCombine is false, insert both controls } else { slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop); } // if auto controls selector was supplied, populate it with the controls if (slider.settings.autoControlsSelector) { $(slider.settings.autoControlsSelector).html(slider.controls.autoEl); - // if auto controls selector was not supplied, add it after the wrapper + // if auto controls selector was not supplied, add it after the wrapper } else { slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl); } @@ -836,10 +850,10 @@ if (slider.active.index === 0) { // set the new position position = slider.children.eq(0).position(); - // carousel, last slide + // carousel, last slide } else if (slider.active.index === getPagerQty() - 1 && slider.carousel) { position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position(); - // last slide + // last slide } else if (slider.active.index === slider.children.length - 1) { position = slider.children.eq(slider.children.length - 1).position(); } @@ -864,7 +878,7 @@ // if autoControlsCombine is true, replace the current control with the new state if (slider.settings.autoControlsCombine) { slider.controls.autoEl.html(slider.controls[state]); - // if autoControlsCombine is false, apply the "active" class to the appropriate control + // if autoControlsCombine is false, apply the "active" class to the appropriate control } else { slider.controls.autoEl.find('a').removeClass('active'); slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active'); @@ -883,35 +897,33 @@ if (slider.active.index === 0) { slider.controls.prev.addClass('disabled'); slider.controls.next.removeClass('disabled'); - // if last slide + // if last slide } else if (slider.active.index === getPagerQty() - 1) { slider.controls.next.addClass('disabled'); slider.controls.prev.removeClass('disabled'); - // if any slide in the middle + // if any slide in the middle } else { slider.controls.prev.removeClass('disabled'); slider.controls.next.removeClass('disabled'); } } }; - + /* auto start and stop functions */ + var windowFocusHandler = function() { el.startAuto(); }; + var windowBlurHandler = function() { el.stopAuto(); }; /** * Initializes the auto process */ var initAuto = function() { // if autoDelay was supplied, launch the auto show using a setTimeout() call if (slider.settings.autoDelay > 0) { - var timeout = setTimeout(el.startAuto, slider.settings.autoDelay); - // if autoDelay was not supplied, start the auto show normally + setTimeout(el.startAuto, slider.settings.autoDelay); + // if autoDelay was not supplied, start the auto show normally } else { el.startAuto(); //add focus and blur events to ensure its running if timeout gets paused - $(window).focus(function() { - el.startAuto(); - }).blur(function() { - el.stopAuto(); - }); + $(window).focus(windowFocusHandler).blur(windowBlurHandler); } // if autoHover is requested if (slider.settings.autoHover) { @@ -941,11 +953,11 @@ */ var initTicker = function() { var startPosition = 0, - position, transform, value, idx, ratio, property, newSpeed, totalDimens; + position, transform, value, idx, ratio, property, newSpeed, totalDimens; // if autoDirection is "next", append a clone of the entire slider if (slider.settings.autoDirection === 'next') { el.append(slider.children.clone().addClass('bx-clone')); - // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position + // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position } else { el.prepend(slider.children.clone().addClass('bx-clone')); position = slider.children.first().position(); @@ -1006,14 +1018,14 @@ */ var tickerLoop = function(resumeSpeed) { var speed = resumeSpeed ? resumeSpeed : slider.settings.speed, - position = {left: 0, top: 0}, - reset = {left: 0, top: 0}, - animateProperty, resetValue, params; + position = {left: 0, top: 0}, + reset = {left: 0, top: 0}, + animateProperty, resetValue, params; // if "next" animate left position to last child, then reset left to 0 if (slider.settings.autoDirection === 'next') { position = el.find('.bx-clone').first().position(); - // if "prev" animate left position to 0, then reset left to first non-clone child + // if "prev" animate left position to 0, then reset left to first non-clone child } else { reset = slider.children.first().position(); } @@ -1028,11 +1040,11 @@ */ var isOnScreen = function(el) { var win = $(window), - viewport = { - top: win.scrollTop(), - left: win.scrollLeft() - }, - bounds = el.offset(); + viewport = { + top: win.scrollTop(), + left: win.scrollLeft() + }, + bounds = el.offset(); viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); @@ -1047,9 +1059,9 @@ */ var keyPress = function(e) { var activeElementTag = document.activeElement.tagName.toLowerCase(), - tagFilters = 'input|textarea', - p = new RegExp(activeElementTag,['i']), - result = p.exec(tagFilters); + tagFilters = 'input|textarea', + p = new RegExp(activeElementTag,['i']), + result = p.exec(tagFilters); if (result == null && isOnScreen(el)) { if (e.keyCode === 39) { @@ -1071,7 +1083,7 @@ start: {x: 0, y: 0}, end: {x: 0, y: 0} }; - slider.viewport.bind('touchstart MSPointerDown pointerdown', onTouchStart); + slider.viewport.on('touchstart MSPointerDown pointerdown', onTouchStart); //for browsers that have implemented pointer events and fire a click after //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not @@ -1090,30 +1102,48 @@ * - DOM event object */ var onTouchStart = function(e) { + // watch only for left mouse, touch contact and pen contact + // touchstart event object doesn`t have button property + if (e.type !== 'touchstart' && e.button !== 0) { + return; + } + //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls slider.controls.el.addClass('disabled'); if (slider.working) { - e.preventDefault(); slider.controls.el.removeClass('disabled'); } else { // record the original position when touch starts slider.touch.originalPos = el.position(); var orig = e.originalEvent, - touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig]; + touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig]; + var chromePointerEvents = typeof PointerEvent === 'function'; + if (chromePointerEvents) { + if (orig.pointerId === undefined) { + return; + } + } // record the starting touch x, y coordinates slider.touch.start.x = touchPoints[0].pageX; slider.touch.start.y = touchPoints[0].pageY; + slider.hasPointerCapture = false; if (slider.viewport.get(0).setPointerCapture) { slider.pointerId = orig.pointerId; - slider.viewport.get(0).setPointerCapture(slider.pointerId); } - // bind a "touchmove" event to the viewport - slider.viewport.bind('touchmove MSPointerMove pointermove', onTouchMove); - // bind a "touchend" event to the viewport - slider.viewport.bind('touchend MSPointerUp pointerup', onTouchEnd); - slider.viewport.bind('MSPointerCancel pointercancel', onPointerCancel); + // store original event data for click fixation + slider.originalClickTarget = orig.originalTarget || orig.target; + slider.originalClickButton = orig.button; + slider.originalClickButtons = orig.buttons; + slider.originalEventType = orig.type; + // at this moment we don`t know what it is click or swipe + slider.hasMove = false; + // on a "touchmove" event to the viewport + slider.viewport.on('touchmove MSPointerMove pointermove', onTouchMove); + // on a "touchend" event to the viewport + slider.viewport.on('touchend MSPointerUp pointerup', onTouchEnd); + slider.viewport.on('MSPointerCancel pointercancel', onPointerCancel); } }; @@ -1124,17 +1154,19 @@ * - DOM event object */ var onPointerCancel = function(e) { + e.preventDefault(); /* onPointerCancel handler is needed to deal with situations when a touchend doesn't fire after a touchstart (this happens on windows phones only) */ setPositionProperty(slider.touch.originalPos.left, 'reset', 0); //remove handlers slider.controls.el.removeClass('disabled'); - slider.viewport.unbind('MSPointerCancel pointercancel', onPointerCancel); - slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove); - slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd); - if (slider.viewport.get(0).releasePointerCapture) { + slider.viewport.off('MSPointerCancel pointercancel', onPointerCancel); + slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove); + slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd); + if (slider.viewport.get(0).releasePointerCapture && slider.hasPointerCapture) { slider.viewport.get(0).releasePointerCapture(slider.pointerId); + slider.hasPointerCapture = false; } }; @@ -1146,26 +1178,41 @@ */ var onTouchMove = function(e) { var orig = e.originalEvent, - touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], - // if scrolling on y axis, do not prevent default - xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x), - yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y), - value = 0, - change = 0; + touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], + // if scrolling on y axis, do not prevent default + xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x), + yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y), + value = 0, + change = 0; + // this is swipe + slider.hasMove = true; + + var hasSwiped = false; + if ((xMovement > 5) || (yMovement > 5)) { + hasSwiped = true; + } + if (slider.viewport.get(0).setPointerCapture && !slider.hasPointerCapture && hasSwiped && (slider.pointerId === 1)) { + slider.viewport.get(0).setPointerCapture(slider.pointerId); + slider.hasPointerCapture = true; + } // x axis swipe if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) { e.preventDefault(); - // y axis swipe + // y axis swipe } else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) { e.preventDefault(); } + if (e.type !== 'touchmove') { + e.preventDefault(); + } + if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) { // if horizontal, drag along x axis if (slider.settings.mode === 'horizontal') { change = touchPoints[0].pageX - slider.touch.start.x; value = slider.touch.originalPos.left + change; - // if vertical, drag along y axis + // if vertical, drag along y axis } else { change = touchPoints[0].pageY - slider.touch.start.y; value = slider.touch.originalPos.top + change; @@ -1181,13 +1228,14 @@ * - DOM event object */ var onTouchEnd = function(e) { - slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove); + e.preventDefault(); + slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove); //enable slider controls as soon as user stops interacing with slides slider.controls.el.removeClass('disabled'); var orig = e.originalEvent, - touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], - value = 0, - distance = 0; + touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], + value = 0, + distance = 0; // record end x, y positions slider.touch.end.x = touchPoints[0].pageX; slider.touch.end.y = touchPoints[0].pageY; @@ -1202,7 +1250,7 @@ } el.stopAuto(); } - // not fade mode + // not fade mode } else { // calculate distance and el's animate property if (slider.settings.mode === 'horizontal') { @@ -1230,10 +1278,24 @@ } } } - slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd); + slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd); + if (slider.viewport.get(0).releasePointerCapture) { slider.viewport.get(0).releasePointerCapture(slider.pointerId); } + // if slider had swipe with left mouse, touch contact and pen contact + if (slider.hasMove === false && (slider.originalClickButton === 0 || slider.originalEventType === 'touchstart')) { + // trigger click event (fix for Firefox59 and PointerEvent standard compatibility) + $(slider.originalClickTarget).trigger({ + type: 'click', + button: slider.originalClickButton, + buttons: slider.originalClickButtons + }); + } + if (slider.viewport.get(0).releasePointerCapture && slider.hasPointerCapture) { + slider.viewport.get(0).releasePointerCapture(slider.pointerId); + slider.hasPointerCapture = false; + } }; /** @@ -1248,7 +1310,7 @@ } else { // get the new window dimens (again, thank you IE) var windowWidthNew = $(window).width(), - windowHeightNew = $(window).height(); + windowHeightNew = $(window).height(); // make sure that it is a true window resize // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements // are resized. Can you just die already?* @@ -1295,7 +1357,7 @@ //we don't go to undefined slides return slider.active.index; } - // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop) + // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop) } else if (slideIndex >= getPagerQty()) { if (slider.settings.infiniteLoop) { return 0; @@ -1303,7 +1365,7 @@ //we don't move to undefined pages return slider.active.index; } - // set active index to requested slide + // set active index to requested slide } else { return slideIndex; } @@ -1328,10 +1390,10 @@ // onSlideBefore, onSlideNext, onSlidePrev callbacks // Allow transition canceling based on returned value var performTransition = true, - moveBy = 0, - position = {left: 0, top: 0}, - lastChild = null, - lastShowingIndex, eq, value, requestEl; + moveBy = 0, + position = {left: 0, top: 0}, + lastChild = null, + lastShowingIndex, eq, value, requestEl; // store the old index slider.oldIndex = slider.active.index; //set new index @@ -1382,7 +1444,7 @@ $(this).css('zIndex', slider.settings.slideZIndex); updateAfterSlideTransition(); }); - // slider mode is not "fade" + // slider mode is not "fade" } else { // if adaptiveHeight is true and next height is different from current height, animate to the new height if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) { @@ -1407,12 +1469,12 @@ eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides); lastChild = el.children('.bx-clone').eq(eq); position = lastChild.position(); - // if infinite loop and "Next" is clicked on the last slide + // if infinite loop and "Next" is clicked on the last slide } else if (direction === 'next' && slider.active.index === 0) { // get the last clone position position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position(); slider.active.last = false; - // normal non-zero requests + // normal non-zero requests } else if (slideIndex >= 0) { //parseInt is applied to allow floats for slides/page requestEl = slideIndex * parseInt(getMoveBy()); @@ -1427,9 +1489,8 @@ value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top; // plugin values to be animated setPositionProperty(value, 'slide', slider.settings.speed); - } else { - slider.working = false; } + slider.working = false; } if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); } }; @@ -1440,6 +1501,7 @@ el.goToNextSlide = function() { // if infiniteLoop is false and last page is showing, disregard call if (!slider.settings.infiniteLoop && slider.active.last) { return; } + if (slider.working === true){ return ;} var pagerIndex = parseInt(slider.active.index) + 1; el.goToSlide(pagerIndex, 'next'); }; @@ -1450,6 +1512,7 @@ el.goToPrevSlide = function() { // if infiniteLoop is false and last page is showing, disregard call if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; } + if (slider.working === true){ return ;} var pagerIndex = parseInt(slider.active.index) - 1; el.goToSlide(pagerIndex, 'prev'); }; @@ -1471,6 +1534,8 @@ el.goToPrevSlide(); } }, slider.settings.pause); + //allback for when the auto rotate status changes + slider.settings.onAutoChange.call(el, true); // if auto controls are displayed and preventControlUpdate is not true if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('stop'); } }; @@ -1482,11 +1547,15 @@ * - if true, auto controls state will not be updated */ el.stopAuto = function(preventControlUpdate) { + // if slider is auto paused, just clear that state + if (slider.autoPaused) slider.autoPaused = false; // if no interval exists, disregard call if (!slider.interval) { return; } // clear the interval clearInterval(slider.interval); slider.interval = null; + //allback for when the auto rotate status changes + slider.settings.onAutoChange.call(el, false); // if auto controls are displayed and preventControlUpdate is not true if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); } }; @@ -1579,10 +1648,12 @@ $('.bx-caption', this).remove(); if (slider.controls.autoEl) { slider.controls.autoEl.remove(); } clearInterval(slider.interval); - if (slider.settings.responsive) { $(window).unbind('resize', resizeWindow); } - if (slider.settings.keyboardEnabled) { $(document).unbind('keydown', keyPress); } + if (slider.settings.responsive) { $(window).off('resize', resizeWindow); } + if (slider.settings.keyboardEnabled) { $(document).off('keydown', keyPress); } //remove self reference in data $(this).removeData('bxSlider'); + // remove global window handlers + $(window).off('blur', windowBlurHandler).off('focus', windowFocusHandler); }; /** @@ -1604,4 +1675,4 @@ return this; }; -})(jQuery); +})(jQuery); \ No newline at end of file diff --git a/assets/bxSlider/jquery.bxslider.min.js b/assets/bxSlider/jquery.bxslider.min.js index 16e64c0..84cf47f 100644 --- a/assets/bxSlider/jquery.bxslider.min.js +++ b/assets/bxSlider/jquery.bxslider.min.js @@ -1,7 +1,8 @@ /** - * bxSlider v4.2.12 - * Copyright 2013-2015 Steven Wanderski + * bxSlider v4.2.1d + * Copyright 2013-2017 Steven Wanderski + * fix https://github.com/stevenwanderski/bxslider-4/issues/1240#issuecomment-482294169 * Written while drinking Belgian ales and listening to jazz * Licensed under MIT (http://opensource.org/licenses/MIT) */ -!function(t){var e={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,wrapperClass:"bx-wrapper",touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,ariaLive:!0,ariaHidden:!0,keyboardEnabled:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",stopAutoOnClick:!1,autoHover:!1,autoDelay:0,autoSlideForOnePage:!1,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,shrinkItems:!1,onSliderLoad:function(){return!0},onSlideBefore:function(){return!0},onSlideAfter:function(){return!0},onSlideNext:function(){return!0},onSlidePrev:function(){return!0},onSliderResize:function(){return!0}};t.fn.bxSlider=function(n){if(0===this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var s={},o=this,r=t(window).width(),a=t(window).height();if(!t(o).data("bxSlider")){var l=function(){t(o).data("bxSlider")||(s.settings=t.extend({},e,n),s.settings.slideWidth=parseInt(s.settings.slideWidth),s.children=o.children(s.settings.slideSelector),s.children.length1||s.settings.maxSlides>1,s.carousel&&(s.settings.preloadImages="all"),s.minThreshold=s.settings.minSlides*s.settings.slideWidth+(s.settings.minSlides-1)*s.settings.slideMargin,s.maxThreshold=s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin,s.working=!1,s.controls={},s.interval=null,s.animProp="vertical"===s.settings.mode?"top":"left",s.usingCSS=s.settings.useCSS&&"fade"!==s.settings.mode&&function(){for(var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],i=0;i
'),s.viewport=o.parent(),s.settings.ariaLive&&!s.settings.ticker&&s.viewport.attr("aria-live","polite"),s.loader=t('
'),s.viewport.prepend(s.loader),o.css({width:"horizontal"===s.settings.mode?1e3*s.children.length+215+"%":"auto",position:"relative"}),s.usingCSS&&s.settings.easing?o.css("-"+s.cssPrefix+"-transition-timing-function",s.settings.easing):s.settings.easing||(s.settings.easing="swing"),s.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),s.viewport.parent().css({maxWidth:u()}),s.children.css({float:"horizontal"===s.settings.mode?"left":"none",listStyle:"none",position:"relative"}),s.children.css("width",h()),"horizontal"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginRight",s.settings.slideMargin),"vertical"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginBottom",s.settings.slideMargin),"fade"===s.settings.mode&&(s.children.css({position:"absolute",zIndex:0,display:"none"}),s.children.eq(s.settings.startSlide).css({zIndex:s.settings.slideZIndex,display:"block"})),s.controls.el=t('
'),s.settings.captions&&P(),s.active.last=s.settings.startSlide===f()-1,s.settings.video&&o.fitVids(),("all"===s.settings.preloadImages||s.settings.ticker)&&(e=s.children),s.settings.ticker?s.settings.pager=!1:(s.settings.controls&&C(),s.settings.auto&&s.settings.autoControls&&T(),s.settings.pager&&w(),(s.settings.controls||s.settings.autoControls||s.settings.pager)&&s.viewport.after(s.controls.el)),c(e,g)},c=function(e,i){var n=e.find('img:not([src=""]), iframe').length,s=0;return 0===n?void i():void e.find('img:not([src=""]), iframe').each(function(){t(this).one("load error",function(){++s===n&&i()}).each(function(){this.complete&&t(this).trigger("load")})})},g=function(){if(s.settings.infiniteLoop&&"fade"!==s.settings.mode&&!s.settings.ticker){var e="vertical"===s.settings.mode?s.settings.minSlides:s.settings.maxSlides,i=s.children.slice(0,e).clone(!0).addClass("bx-clone"),n=s.children.slice(-e).clone(!0).addClass("bx-clone");s.settings.ariaHidden&&(i.attr("aria-hidden",!0),n.attr("aria-hidden",!0)),o.append(i).prepend(n)}s.loader.remove(),m(),"vertical"===s.settings.mode&&(s.settings.adaptiveHeight=!0),s.viewport.height(p()),o.redrawSlider(),s.settings.onSliderLoad.call(o,s.active.index),s.initialized=!0,s.settings.responsive&&t(window).bind("resize",Z),s.settings.auto&&s.settings.autoStart&&(f()>1||s.settings.autoSlideForOnePage)&&H(),s.settings.ticker&&W(),s.settings.pager&&I(s.settings.startSlide),s.settings.controls&&D(),s.settings.touchEnabled&&!s.settings.ticker&&N(),s.settings.keyboardEnabled&&!s.settings.ticker&&t(document).keydown(F)},p=function(){var e=0,n=t();if("vertical"===s.settings.mode||s.settings.adaptiveHeight)if(s.carousel){var o=1===s.settings.moveSlides?s.active.index:s.active.index*x();for(n=s.children.eq(o),i=1;i<=s.settings.maxSlides-1;i++)n=o+i>=s.children.length?n.add(s.children.eq(i-1)):n.add(s.children.eq(o+i))}else n=s.children.eq(s.active.index);else n=s.children;return"vertical"===s.settings.mode?(n.each(function(i){e+=t(this).outerHeight()}),s.settings.slideMargin>0&&(e+=s.settings.slideMargin*(s.settings.minSlides-1))):e=Math.max.apply(Math,n.map(function(){return t(this).outerHeight(!1)}).get()),"border-box"===s.viewport.css("box-sizing")?e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))+parseFloat(s.viewport.css("border-top-width"))+parseFloat(s.viewport.css("border-bottom-width")):"padding-box"===s.viewport.css("box-sizing")&&(e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))),e},u=function(){var t="100%";return s.settings.slideWidth>0&&(t="horizontal"===s.settings.mode?s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin:s.settings.slideWidth),t},h=function(){var t=s.settings.slideWidth,e=s.viewport.width();if(0===s.settings.slideWidth||s.settings.slideWidth>e&&!s.carousel||"vertical"===s.settings.mode)t=e;else if(s.settings.maxSlides>1&&"horizontal"===s.settings.mode){if(e>s.maxThreshold)return t;e0?s.viewport.width()s.maxThreshold?t=s.settings.maxSlides:(e=s.children.first().width()+s.settings.slideMargin,t=Math.floor((s.viewport.width()+s.settings.slideMargin)/e)):"vertical"===s.settings.mode&&(t=s.settings.minSlides),t},f=function(){var t=0,e=0,i=0;if(s.settings.moveSlides>0)if(s.settings.infiniteLoop)t=Math.ceil(s.children.length/x());else for(;e0&&s.settings.moveSlides<=v()?s.settings.moveSlides:v()},m=function(){var t,e,i;s.children.length>s.settings.maxSlides&&s.active.last&&!s.settings.infiniteLoop?"horizontal"===s.settings.mode?(e=s.children.last(),t=e.position(),S(-(t.left-(s.viewport.width()-e.outerWidth())),"reset",0)):"vertical"===s.settings.mode&&(i=s.children.length-s.settings.minSlides,t=s.children.eq(i).position(),S(-t.top,"reset",0)):(t=s.children.eq(s.active.index*x()).position(),s.active.index===f()-1&&(s.active.last=!0),void 0!==t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0)))},S=function(e,i,n,r){var a,l;s.usingCSS?(l="vertical"===s.settings.mode?"translate3d(0, "+e+"px, 0)":"translate3d("+e+"px, 0, 0)",o.css("-"+s.cssPrefix+"-transition-duration",n/1e3+"s"),"slide"===i?(o.css(s.animProp,l),0!==n?o.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(e){t(e.target).is(o)&&(o.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),q())}):q()):"reset"===i?o.css(s.animProp,l):"ticker"===i&&(o.css("-"+s.cssPrefix+"-transition-timing-function","linear"),o.css(s.animProp,l),0!==n?o.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(e){t(e.target).is(o)&&(o.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),S(r.resetValue,"reset",0),L())}):(S(r.resetValue,"reset",0),L()))):(a={},a[s.animProp]=e,"slide"===i?o.animate(a,n,s.settings.easing,function(){q()}):"reset"===i?o.css(s.animProp,e):"ticker"===i&&o.animate(a,n,"linear",function(){S(r.resetValue,"reset",0),L()}))},b=function(){for(var e="",i="",n=f(),o=0;o'+i+"
";s.pagerEl.html(e)},w=function(){s.settings.pagerCustom?s.pagerEl=t(s.settings.pagerCustom):(s.pagerEl=t('
'),s.settings.pagerSelector?t(s.settings.pagerSelector).html(s.pagerEl):s.controls.el.addClass("bx-has-pager").append(s.pagerEl),b()),s.pagerEl.on("click touchend","a",z)},C=function(){s.controls.next=t(''+s.settings.nextText+""),s.controls.prev=t(''+s.settings.prevText+""),s.controls.next.bind("click touchend",E),s.controls.prev.bind("click touchend",k),s.settings.nextSelector&&t(s.settings.nextSelector).append(s.controls.next),s.settings.prevSelector&&t(s.settings.prevSelector).append(s.controls.prev),s.settings.nextSelector||s.settings.prevSelector||(s.controls.directionEl=t('
'),s.controls.directionEl.append(s.controls.prev).append(s.controls.next),s.controls.el.addClass("bx-has-controls-direction").append(s.controls.directionEl))},T=function(){s.controls.start=t('"),s.controls.stop=t('"),s.controls.autoEl=t('
'),s.controls.autoEl.on("click",".bx-start",M),s.controls.autoEl.on("click",".bx-stop",y),s.settings.autoControlsCombine?s.controls.autoEl.append(s.controls.start):s.controls.autoEl.append(s.controls.start).append(s.controls.stop),s.settings.autoControlsSelector?t(s.settings.autoControlsSelector).html(s.controls.autoEl):s.controls.el.addClass("bx-has-controls-auto").append(s.controls.autoEl),A(s.settings.autoStart?"stop":"start")},P=function(){s.children.each(function(e){var i=t(this).find("img:first").attr("title");void 0!==i&&(""+i).length&&t(this).append('
'+i+"
")})},E=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToNextSlide())},k=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToPrevSlide())},M=function(t){o.startAuto(),t.preventDefault()},y=function(t){o.stopAuto(),t.preventDefault()},z=function(e){var i,n;e.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),i=t(e.currentTarget),void 0!==i.attr("data-slide-index")&&(n=parseInt(i.attr("data-slide-index")),n!==s.active.index&&o.goToSlide(n)))},I=function(e){var i=s.children.length;return"short"===s.settings.pagerType?(s.settings.maxSlides>1&&(i=Math.ceil(s.children.length/s.settings.maxSlides)),void s.pagerEl.html(e+1+s.settings.pagerShortSeparator+i)):(s.pagerEl.find("a").removeClass("active"),void s.pagerEl.each(function(i,n){t(n).find("a").eq(e).addClass("active")}))},q=function(){if(s.settings.infiniteLoop){var t="";0===s.active.index?t=s.children.eq(0).position():s.active.index===f()-1&&s.carousel?t=s.children.eq((f()-1)*x()).position():s.active.index===s.children.length-1&&(t=s.children.eq(s.children.length-1).position()),t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0))}s.working=!1,s.settings.onSlideAfter.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)},A=function(t){s.settings.autoControlsCombine?s.controls.autoEl.html(s.controls[t]):(s.controls.autoEl.find("a").removeClass("active"),s.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},D=function(){1===f()?(s.controls.prev.addClass("disabled"),s.controls.next.addClass("disabled")):!s.settings.infiniteLoop&&s.settings.hideControlOnEnd&&(0===s.active.index?(s.controls.prev.addClass("disabled"),s.controls.next.removeClass("disabled")):s.active.index===f()-1?(s.controls.next.addClass("disabled"),s.controls.prev.removeClass("disabled")):(s.controls.prev.removeClass("disabled"),s.controls.next.removeClass("disabled")))},H=function(){if(s.settings.autoDelay>0){setTimeout(o.startAuto,s.settings.autoDelay)}else o.startAuto(),t(window).focus(function(){o.startAuto()}).blur(function(){o.stopAuto()});s.settings.autoHover&&o.hover(function(){s.interval&&(o.stopAuto(!0),s.autoPaused=!0)},function(){s.autoPaused&&(o.startAuto(!0),s.autoPaused=null)})},W=function(){var e,i,n,r,a,l,d,c,g=0;"next"===s.settings.autoDirection?o.append(s.children.clone().addClass("bx-clone")):(o.prepend(s.children.clone().addClass("bx-clone")),e=s.children.first().position(),g="horizontal"===s.settings.mode?-e.left:-e.top),S(g,"reset",0),s.settings.pager=!1,s.settings.controls=!1,s.settings.autoControls=!1,s.settings.tickerHover&&(s.usingCSS?(r="horizontal"===s.settings.mode?4:5,s.viewport.hover(function(){i=o.css("-"+s.cssPrefix+"-transform"),n=parseFloat(i.split(",")[r]),S(n,"reset",0)},function(){c=0,s.children.each(function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)}),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(n))),L(d)})):s.viewport.hover(function(){o.stop()},function(){c=0,s.children.each(function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)}),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(o.css(l)))),L(d)})),L()},L=function(t){var e,i,n,r=t?t:s.settings.speed,a={left:0,top:0},l={left:0,top:0};"next"===s.settings.autoDirection?a=o.find(".bx-clone").first().position():l=s.children.first().position(),e="horizontal"===s.settings.mode?-a.left:-a.top,i="horizontal"===s.settings.mode?-l.left:-l.top,n={resetValue:i},S(e,"ticker",r,n)},O=function(e){var i=t(window),n={top:i.scrollTop(),left:i.scrollLeft()},s=e.offset();return n.right=n.left+i.width(),n.bottom=n.top+i.height(),s.right=s.left+e.outerWidth(),s.bottom=s.top+e.outerHeight(),!(n.rights.right||n.bottoms.bottom)},F=function(t){var e=document.activeElement.tagName.toLowerCase(),i="input|textarea",n=new RegExp(e,["i"]),s=n.exec(i);if(null==s&&O(o)){if(39===t.keyCode)return E(t),!1;if(37===t.keyCode)return k(t),!1}},N=function(){s.touch={start:{x:0,y:0},end:{x:0,y:0}},s.viewport.bind("touchstart MSPointerDown pointerdown",X),s.viewport.on("click",".bxslider a",function(t){s.viewport.hasClass("click-disabled")&&(t.preventDefault(),s.viewport.removeClass("click-disabled"))})},X=function(t){if(s.controls.el.addClass("disabled"),s.working)t.preventDefault(),s.controls.el.removeClass("disabled");else{s.touch.originalPos=o.position();var e=t.originalEvent,i="undefined"!=typeof e.changedTouches?e.changedTouches:[e];s.touch.start.x=i[0].pageX,s.touch.start.y=i[0].pageY,s.viewport.get(0).setPointerCapture&&(s.pointerId=e.pointerId,s.viewport.get(0).setPointerCapture(s.pointerId)),s.viewport.bind("touchmove MSPointerMove pointermove",V),s.viewport.bind("touchend MSPointerUp pointerup",R),s.viewport.bind("MSPointerCancel pointercancel",Y)}},Y=function(t){S(s.touch.originalPos.left,"reset",0),s.controls.el.removeClass("disabled"),s.viewport.unbind("MSPointerCancel pointercancel",Y),s.viewport.unbind("touchmove MSPointerMove pointermove",V),s.viewport.unbind("touchend MSPointerUp pointerup",R),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId)},V=function(t){var e=t.originalEvent,i="undefined"!=typeof e.changedTouches?e.changedTouches:[e],n=Math.abs(i[0].pageX-s.touch.start.x),o=Math.abs(i[0].pageY-s.touch.start.y),r=0,a=0;3*n>o&&s.settings.preventDefaultSwipeX?t.preventDefault():3*o>n&&s.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!==s.settings.mode&&s.settings.oneToOneTouch&&("horizontal"===s.settings.mode?(a=i[0].pageX-s.touch.start.x,r=s.touch.originalPos.left+a):(a=i[0].pageY-s.touch.start.y,r=s.touch.originalPos.top+a),S(r,"reset",0))},R=function(t){s.viewport.unbind("touchmove MSPointerMove pointermove",V),s.controls.el.removeClass("disabled");var e=t.originalEvent,i="undefined"!=typeof e.changedTouches?e.changedTouches:[e],n=0,r=0;s.touch.end.x=i[0].pageX,s.touch.end.y=i[0].pageY,"fade"===s.settings.mode?(r=Math.abs(s.touch.start.x-s.touch.end.x),r>=s.settings.swipeThreshold&&(s.touch.start.x>s.touch.end.x?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto())):("horizontal"===s.settings.mode?(r=s.touch.end.x-s.touch.start.x,n=s.touch.originalPos.left):(r=s.touch.end.y-s.touch.start.y,n=s.touch.originalPos.top),!s.settings.infiniteLoop&&(0===s.active.index&&r>0||s.active.last&&r<0)?S(n,"reset",200):Math.abs(r)>=s.settings.swipeThreshold?(r<0?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):S(n,"reset",200)),s.viewport.unbind("touchend MSPointerUp pointerup",R),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId)},Z=function(e){if(s.initialized)if(s.working)window.setTimeout(Z,10);else{var i=t(window).width(),n=t(window).height();r===i&&a===n||(r=i,a=n,o.redrawSlider(),s.settings.onSliderResize.call(o,s.active.index))}},B=function(t){var e=v();s.settings.ariaHidden&&!s.settings.ticker&&(s.children.attr("aria-hidden","true"),s.children.slice(t,t+e).attr("aria-hidden","false"))},U=function(t){return t<0?s.settings.infiniteLoop?f()-1:s.active.index:t>=f()?s.settings.infiniteLoop?0:s.active.index:t};return o.goToSlide=function(e,i){var n,r,a,l,d=!0,c=0,g={left:0,top:0},u=null;if(s.oldIndex=s.active.index,s.active.index=U(e),!s.working&&s.active.index!==s.oldIndex){if(s.working=!0,d=s.settings.onSlideBefore.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index),"undefined"!=typeof d&&!d)return s.active.index=s.oldIndex,void(s.working=!1);"next"===i?s.settings.onSlideNext.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1):"prev"===i&&(s.settings.onSlidePrev.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1)),s.active.last=s.active.index>=f()-1,(s.settings.pager||s.settings.pagerCustom)&&I(s.active.index),s.settings.controls&&D(),"fade"===s.settings.mode?(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),s.children.filter(":visible").fadeOut(s.settings.speed).css({zIndex:0}),s.children.eq(s.active.index).css("zIndex",s.settings.slideZIndex+1).fadeIn(s.settings.speed,function(){t(this).css("zIndex",s.settings.slideZIndex),q()})):(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),!s.settings.infiniteLoop&&s.carousel&&s.active.last?"horizontal"===s.settings.mode?(u=s.children.eq(s.children.length-1),g=u.position(),c=s.viewport.width()-u.outerWidth()):(n=s.children.length-s.settings.minSlides,g=s.children.eq(n).position()):s.carousel&&s.active.last&&"prev"===i?(r=1===s.settings.moveSlides?s.settings.maxSlides-x():(f()-1)*x()-(s.children.length-s.settings.maxSlides),u=o.children(".bx-clone").eq(r),g=u.position()):"next"===i&&0===s.active.index?(g=o.find("> .bx-clone").eq(s.settings.maxSlides).position(),s.active.last=!1):e>=0&&(l=e*parseInt(x()),g=s.children.eq(l).position()),"undefined"!=typeof g?(a="horizontal"===s.settings.mode?-(g.left-c):-g.top,S(a,"slide",s.settings.speed)):s.working=!1),s.settings.ariaHidden&&B(s.active.index*x())}},o.goToNextSlide=function(){if(s.settings.infiniteLoop||!s.active.last){var t=parseInt(s.active.index)+1;o.goToSlide(t,"next")}},o.goToPrevSlide=function(){if(s.settings.infiniteLoop||0!==s.active.index){var t=parseInt(s.active.index)-1;o.goToSlide(t,"prev")}},o.startAuto=function(t){s.interval||(s.interval=setInterval(function(){"next"===s.settings.autoDirection?o.goToNextSlide():o.goToPrevSlide()},s.settings.pause),s.settings.autoControls&&t!==!0&&A("stop"))},o.stopAuto=function(t){s.interval&&(clearInterval(s.interval),s.interval=null,s.settings.autoControls&&t!==!0&&A("start"))},o.getCurrentSlide=function(){return s.active.index},o.getCurrentSlideElement=function(){return s.children.eq(s.active.index)},o.getSlideElement=function(t){return s.children.eq(t)},o.getSlideCount=function(){return s.children.length},o.isWorking=function(){return s.working},o.redrawSlider=function(){s.children.add(o.find(".bx-clone")).outerWidth(h()),s.viewport.css("height",p()),s.settings.ticker||m(),s.active.last&&(s.active.index=f()-1),s.active.index>=f()&&(s.active.last=!0),s.settings.pager&&!s.settings.pagerCustom&&(b(),I(s.active.index)),s.settings.ariaHidden&&B(s.active.index*x())},o.destroySlider=function(){s.initialized&&(s.initialized=!1,t(".bx-clone",this).remove(),s.children.each(function(){void 0!==t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!==t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),s.controls.el&&s.controls.el.remove(),s.controls.next&&s.controls.next.remove(),s.controls.prev&&s.controls.prev.remove(),s.pagerEl&&s.settings.controls&&!s.settings.pagerCustom&&s.pagerEl.remove(),t(".bx-caption",this).remove(),s.controls.autoEl&&s.controls.autoEl.remove(),clearInterval(s.interval),s.settings.responsive&&t(window).unbind("resize",Z),s.settings.keyboardEnabled&&t(document).unbind("keydown",F),t(this).removeData("bxSlider"))},o.reloadSlider=function(e){void 0!==e&&(n=e),o.destroySlider(),l(),t(o).data("bxSlider",this)},l(),t(o).data("bxSlider",this),this}}}(jQuery); \ No newline at end of file +!function(t){var e={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,wrapperClass:"bx-wrapper",touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,ariaLive:!0,ariaHidden:!0,keyboardEnabled:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",stopAutoOnClick:!1,autoHover:!1,autoDelay:0,autoSlideForOnePage:!1,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,shrinkItems:!1,onSliderLoad:function(){return!0},onSlideBefore:function(){return!0},onSlideAfter:function(){return!0},onSlideNext:function(){return!0},onSlidePrev:function(){return!0},onSliderResize:function(){return!0},onAutoChange:function(){return!0}};t.fn.bxSlider=function(n){if(0===this.length)return this;if(this.length>1)return this.each((function(){t(this).bxSlider(n)})),this;var s={},o=this,r=t(window).width(),a=t(window).height();if(!t(o).data("bxSlider")){var l=function(){t(o).data("bxSlider")||(s.settings=t.extend({},e,n),s.settings.slideWidth=parseInt(s.settings.slideWidth),s.children=o.children(s.settings.slideSelector),s.children.length1||s.settings.maxSlides>1,s.carousel&&(s.settings.preloadImages="all"),s.minThreshold=s.settings.minSlides*s.settings.slideWidth+(s.settings.minSlides-1)*s.settings.slideMargin,s.maxThreshold=s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin,s.working=!1,s.controls={},s.interval=null,s.animProp="vertical"===s.settings.mode?"top":"left",s.usingCSS=s.settings.useCSS&&"fade"!==s.settings.mode&&function(){for(var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],i=0;i
'),s.viewport=o.parent(),s.settings.ariaLive&&!s.settings.ticker&&s.viewport.attr("aria-live","polite"),s.loader=t('
'),s.viewport.prepend(s.loader),o.css({width:"horizontal"===s.settings.mode?1e3*s.children.length+215+"%":"auto",position:"relative"}),s.usingCSS&&s.settings.easing?o.css("-"+s.cssPrefix+"-transition-timing-function",s.settings.easing):s.settings.easing||(s.settings.easing="swing"),s.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),s.viewport.parent().css({maxWidth:u()}),s.children.css({float:"horizontal"===s.settings.mode?"left":"none",listStyle:"none",position:"relative"}),s.children.css("width",h()),"horizontal"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginRight",s.settings.slideMargin),"vertical"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginBottom",s.settings.slideMargin),"fade"===s.settings.mode&&(s.children.css({position:"absolute",zIndex:0,display:"none"}),s.children.eq(s.settings.startSlide).css({zIndex:s.settings.slideZIndex,display:"block"})),s.controls.el=t('
'),s.settings.captions&&T(),s.active.last=s.settings.startSlide===f()-1,s.settings.video&&o.fitVids(),"none"===s.settings.preloadImages?e=null:("all"===s.settings.preloadImages||s.settings.ticker)&&(e=s.children),s.settings.ticker?s.settings.pager=!1:(s.settings.controls&&C(),s.settings.auto&&s.settings.autoControls&&P(),s.settings.pager&&b(),(s.settings.controls||s.settings.autoControls||s.settings.pager)&&s.viewport.after(s.controls.el)),null===e?g():c(e,g)},c=function(e,i){var n=e.find('img:not([src=""]), iframe').length,s=0;0!==n?e.find('img:not([src=""]), iframe').each((function(){t(this).one("load error",(function(){++s===n&&i()})).each((function(){(this.complete||""==this.src)&&t(this).trigger("load")}))})):i()},g=function(){if(s.settings.infiniteLoop&&"fade"!==s.settings.mode&&!s.settings.ticker){var e="vertical"===s.settings.mode?s.settings.minSlides:s.settings.maxSlides,i=s.children.slice(0,e).clone(!0).addClass("bx-clone"),n=s.children.slice(-e).clone(!0).addClass("bx-clone");s.settings.ariaHidden&&(i.attr("aria-hidden",!0),n.attr("aria-hidden",!0)),o.append(i).prepend(n)}s.loader.remove(),m(),"vertical"===s.settings.mode&&(s.settings.adaptiveHeight=!0),s.viewport.height(p()),o.redrawSlider(),s.settings.onSliderLoad.call(o,s.active.index),s.initialized=!0,s.settings.responsive&&t(window).on("resize",Z),s.settings.auto&&s.settings.autoStart&&(f()>1||s.settings.autoSlideForOnePage)&&L(),s.settings.ticker&&O(),s.settings.pager&&z(s.settings.startSlide),s.settings.controls&&D(),s.settings.touchEnabled&&!s.settings.ticker&&B(),s.settings.keyboardEnabled&&!s.settings.ticker&&t(document).keydown(N)},p=function(){var e=0,n=t();if("vertical"===s.settings.mode||s.settings.adaptiveHeight)if(s.carousel){var o=1===s.settings.moveSlides?s.active.index:s.active.index*x();for(n=s.children.eq(o),i=1;i<=s.settings.maxSlides-1;i++)n=o+i>=s.children.length?n.add(s.children.eq(i-1)):n.add(s.children.eq(o+i))}else n=s.children.eq(s.active.index);else n=s.children;return"vertical"===s.settings.mode?(n.each((function(i){e+=t(this).outerHeight()})),s.settings.slideMargin>0&&(e+=s.settings.slideMargin*(s.settings.minSlides-1))):e=Math.max.apply(Math,n.map((function(){return t(this).outerHeight(!1)})).get()),"border-box"===s.viewport.css("box-sizing")?e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))+parseFloat(s.viewport.css("border-top-width"))+parseFloat(s.viewport.css("border-bottom-width")):"padding-box"===s.viewport.css("box-sizing")&&(e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))),e},u=function(){var t="100%";return s.settings.slideWidth>0&&(t="horizontal"===s.settings.mode?s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin:s.settings.slideWidth),t},h=function(){var t=s.settings.slideWidth,e=s.viewport.width();if(0===s.settings.slideWidth||s.settings.slideWidth>e&&!s.carousel||"vertical"===s.settings.mode)t=e;else if(s.settings.maxSlides>1&&"horizontal"===s.settings.mode){if(e>s.maxThreshold)return t;e0?s.viewport.width()s.maxThreshold?t=s.settings.maxSlides:(e=s.children.first().width()+s.settings.slideMargin,t=Math.floor((s.viewport.width()+s.settings.slideMargin)/e)||1):"vertical"===s.settings.mode&&(t=s.settings.minSlides),t},f=function(){var t=0,e=0,i=0;if(s.settings.moveSlides>0){if(!s.settings.infiniteLoop){for(;e0&&s.settings.moveSlides<=v()?s.settings.moveSlides:v()},m=function(){var t,e,i;s.children.length>s.settings.maxSlides&&s.active.last&&!s.settings.infiniteLoop?"horizontal"===s.settings.mode?(t=(e=s.children.last()).position(),S(-(t.left-(s.viewport.width()-e.outerWidth())),"reset",0)):"vertical"===s.settings.mode&&(i=s.children.length-s.settings.minSlides,t=s.children.eq(i).position(),S(-t.top,"reset",0)):(t=s.children.eq(s.active.index*x()).position(),s.active.index===f()-1&&(s.active.last=!0),void 0!==t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0)))},S=function(e,i,n,r){var a,l;s.usingCSS?(l="vertical"===s.settings.mode?"translate3d(0, "+e+"px, 0)":"translate3d("+e+"px, 0, 0)",o.css("-"+s.cssPrefix+"-transition-duration",n/1e3+"s"),"slide"===i?(o.css(s.animProp,l),0!==n?o.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",(function(e){t(e.target).is(o)&&(o.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),A())})):A()):"reset"===i?o.css(s.animProp,l):"ticker"===i&&(o.css("-"+s.cssPrefix+"-transition-timing-function","linear"),o.css(s.animProp,l),0!==n?o.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",(function(e){t(e.target).is(o)&&(o.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),S(r.resetValue,"reset",0),F())})):(S(r.resetValue,"reset",0),F()))):((a={})[s.animProp]=e,"slide"===i?o.animate(a,n,s.settings.easing,(function(){A()})):"reset"===i?o.css(s.animProp,e):"ticker"===i&&o.animate(a,n,"linear",(function(){S(r.resetValue,"reset",0),F()})))},w=function(){for(var e="",i="",n=f(),o=0;o'+i+"
";s.pagerEl.html(e)},b=function(){s.settings.pagerCustom?s.pagerEl=t(s.settings.pagerCustom):(s.pagerEl=t('
'),s.settings.pagerSelector?t(s.settings.pagerSelector).html(s.pagerEl):s.controls.el.addClass("bx-has-pager").append(s.pagerEl),w()),s.pagerEl.on("click touchend","a",I)},C=function(){s.controls.next=t(''+s.settings.nextText+""),s.controls.prev=t(''+s.settings.prevText+""),s.controls.next.on("click touchend",k),s.controls.prev.on("click touchend",E),s.settings.nextSelector&&t(s.settings.nextSelector).append(s.controls.next),s.settings.prevSelector&&t(s.settings.prevSelector).append(s.controls.prev),s.settings.nextSelector||s.settings.prevSelector||(s.controls.directionEl=t('
'),s.controls.directionEl.append(s.controls.prev).append(s.controls.next),s.controls.el.addClass("bx-has-controls-direction").append(s.controls.directionEl))},P=function(){s.controls.start=t('"),s.controls.stop=t('"),s.controls.autoEl=t('
'),s.controls.autoEl.on("click",".bx-start",M),s.controls.autoEl.on("click",".bx-stop",y),s.settings.autoControlsCombine?s.controls.autoEl.append(s.controls.start):s.controls.autoEl.append(s.controls.start).append(s.controls.stop),s.settings.autoControlsSelector?t(s.settings.autoControlsSelector).html(s.controls.autoEl):s.controls.el.addClass("bx-has-controls-auto").append(s.controls.autoEl),q(s.settings.autoStart?"stop":"start")},T=function(){s.children.each((function(e){var i=t(this).find("img:first").attr("title");void 0!==i&&(""+i).length&&t(this).append('
'+i+"
")}))},k=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToNextSlide())},E=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToPrevSlide())},M=function(t){o.startAuto(),t.preventDefault()},y=function(t){o.stopAuto(),t.preventDefault()},I=function(e){var i,n;e.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),void 0!==(i=t(e.currentTarget)).attr("data-slide-index")&&(n=parseInt(i.attr("data-slide-index")))!==s.active.index&&o.goToSlide(n))},z=function(e){var i=s.children.length;if("short"===s.settings.pagerType)return s.settings.maxSlides>1&&(i=Math.ceil(s.children.length/s.settings.maxSlides)),void s.pagerEl.html(e+1+s.settings.pagerShortSeparator+i);s.pagerEl.find("a").removeClass("active"),s.pagerEl.each((function(i,n){t(n).find("a").eq(e).addClass("active")}))},A=function(){if(s.settings.infiniteLoop){var t="";0===s.active.index?t=s.children.eq(0).position():s.active.index===f()-1&&s.carousel?t=s.children.eq((f()-1)*x()).position():s.active.index===s.children.length-1&&(t=s.children.eq(s.children.length-1).position()),t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0))}s.working=!1,s.settings.onSlideAfter.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)},q=function(t){s.settings.autoControlsCombine?s.controls.autoEl.html(s.controls[t]):(s.controls.autoEl.find("a").removeClass("active"),s.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},D=function(){1===f()?(s.controls.prev.addClass("disabled"),s.controls.next.addClass("disabled")):!s.settings.infiniteLoop&&s.settings.hideControlOnEnd&&(0===s.active.index?(s.controls.prev.addClass("disabled"),s.controls.next.removeClass("disabled")):s.active.index===f()-1?(s.controls.next.addClass("disabled"),s.controls.prev.removeClass("disabled")):(s.controls.prev.removeClass("disabled"),s.controls.next.removeClass("disabled")))},H=function(){o.startAuto()},W=function(){o.stopAuto()},L=function(){s.settings.autoDelay>0?setTimeout(o.startAuto,s.settings.autoDelay):(o.startAuto(),t(window).focus(H).blur(W)),s.settings.autoHover&&o.hover((function(){s.interval&&(o.stopAuto(!0),s.autoPaused=!0)}),(function(){s.autoPaused&&(o.startAuto(!0),s.autoPaused=null)}))},O=function(){var e,i,n,r,a,l,d,c,g=0;"next"===s.settings.autoDirection?o.append(s.children.clone().addClass("bx-clone")):(o.prepend(s.children.clone().addClass("bx-clone")),e=s.children.first().position(),g="horizontal"===s.settings.mode?-e.left:-e.top),S(g,"reset",0),s.settings.pager=!1,s.settings.controls=!1,s.settings.autoControls=!1,s.settings.tickerHover&&(s.usingCSS?(r="horizontal"===s.settings.mode?4:5,s.viewport.hover((function(){i=o.css("-"+s.cssPrefix+"-transform"),n=parseFloat(i.split(",")[r]),S(n,"reset",0)}),(function(){c=0,s.children.each((function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)})),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(n))),F(d)}))):s.viewport.hover((function(){o.stop()}),(function(){c=0,s.children.each((function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)})),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(o.css(l)))),F(d)}))),F()},F=function(t){var e,i,n=t||s.settings.speed,r={left:0,top:0},a={left:0,top:0};"next"===s.settings.autoDirection?r=o.find(".bx-clone").first().position():a=s.children.first().position(),e="horizontal"===s.settings.mode?-r.left:-r.top,i="horizontal"===s.settings.mode?-a.left:-a.top,S(e,"ticker",n,{resetValue:i})},N=function(e){var i=document.activeElement.tagName.toLowerCase();if(null==new RegExp(i,["i"]).exec("input|textarea")&&function(e){var i=t(window),n={top:i.scrollTop(),left:i.scrollLeft()},s=e.offset();return n.right=n.left+i.width(),n.bottom=n.top+i.height(),s.right=s.left+e.outerWidth(),s.bottom=s.top+e.outerHeight(),!(n.rights.right||n.bottoms.bottom)}(o)){if(39===e.keyCode)return k(e),!1;if(37===e.keyCode)return E(e),!1}},B=function(){s.touch={start:{x:0,y:0},end:{x:0,y:0}},s.viewport.on("touchstart MSPointerDown pointerdown",X),s.viewport.on("click",".bxslider a",(function(t){s.viewport.hasClass("click-disabled")&&(t.preventDefault(),s.viewport.removeClass("click-disabled"))}))},X=function(t){if("touchstart"===t.type||0===t.button)if(s.controls.el.addClass("disabled"),s.working)s.controls.el.removeClass("disabled");else{s.touch.originalPos=o.position();var e=t.originalEvent,i=void 0!==e.changedTouches?e.changedTouches:[e];if("function"==typeof PointerEvent&&void 0===e.pointerId)return;s.touch.start.x=i[0].pageX,s.touch.start.y=i[0].pageY,s.hasPointerCapture=!1,s.viewport.get(0).setPointerCapture&&(s.pointerId=e.pointerId),s.originalClickTarget=e.originalTarget||e.target,s.originalClickButton=e.button,s.originalClickButtons=e.buttons,s.originalEventType=e.type,s.hasMove=!1,s.viewport.on("touchmove MSPointerMove pointermove",V),s.viewport.on("touchend MSPointerUp pointerup",R),s.viewport.on("MSPointerCancel pointercancel",Y)}},Y=function(t){t.preventDefault(),S(s.touch.originalPos.left,"reset",0),s.controls.el.removeClass("disabled"),s.viewport.off("MSPointerCancel pointercancel",Y),s.viewport.off("touchmove MSPointerMove pointermove",V),s.viewport.off("touchend MSPointerUp pointerup",R),s.viewport.get(0).releasePointerCapture&&s.hasPointerCapture&&(s.viewport.get(0).releasePointerCapture(s.pointerId),s.hasPointerCapture=!1)},V=function(t){var e=t.originalEvent,i=void 0!==e.changedTouches?e.changedTouches:[e],n=Math.abs(i[0].pageX-s.touch.start.x),o=Math.abs(i[0].pageY-s.touch.start.y),r=0,a=0;s.hasMove=!0;var l=!1;(n>5||o>5)&&(l=!0),s.viewport.get(0).setPointerCapture&&!s.hasPointerCapture&&l&&1===s.pointerId&&(s.viewport.get(0).setPointerCapture(s.pointerId),s.hasPointerCapture=!0),(3*n>o&&s.settings.preventDefaultSwipeX||3*o>n&&s.settings.preventDefaultSwipeY)&&t.preventDefault(),"touchmove"!==t.type&&t.preventDefault(),"fade"!==s.settings.mode&&s.settings.oneToOneTouch&&("horizontal"===s.settings.mode?(a=i[0].pageX-s.touch.start.x,r=s.touch.originalPos.left+a):(a=i[0].pageY-s.touch.start.y,r=s.touch.originalPos.top+a),S(r,"reset",0))},R=function(e){e.preventDefault(),s.viewport.off("touchmove MSPointerMove pointermove",V),s.controls.el.removeClass("disabled");var i=e.originalEvent,n=void 0!==i.changedTouches?i.changedTouches:[i],r=0,a=0;s.touch.end.x=n[0].pageX,s.touch.end.y=n[0].pageY,"fade"===s.settings.mode?(a=Math.abs(s.touch.start.x-s.touch.end.x))>=s.settings.swipeThreshold&&(s.touch.start.x>s.touch.end.x?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):("horizontal"===s.settings.mode?(a=s.touch.end.x-s.touch.start.x,r=s.touch.originalPos.left):(a=s.touch.end.y-s.touch.start.y,r=s.touch.originalPos.top),!s.settings.infiniteLoop&&(0===s.active.index&&a>0||s.active.last&&a<0)?S(r,"reset",200):Math.abs(a)>=s.settings.swipeThreshold?(a<0?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):S(r,"reset",200)),s.viewport.off("touchend MSPointerUp pointerup",R),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId),!1!==s.hasMove||0!==s.originalClickButton&&"touchstart"!==s.originalEventType||t(s.originalClickTarget).trigger({type:"click",button:s.originalClickButton,buttons:s.originalClickButtons}),s.viewport.get(0).releasePointerCapture&&s.hasPointerCapture&&(s.viewport.get(0).releasePointerCapture(s.pointerId),s.hasPointerCapture=!1)},Z=function(e){if(s.initialized)if(s.working)window.setTimeout(Z,10);else{var i=t(window).width(),n=t(window).height();r===i&&a===n||(r=i,a=n,o.redrawSlider(),s.settings.onSliderResize.call(o,s.active.index))}},U=function(t){var e=v();s.settings.ariaHidden&&!s.settings.ticker&&(s.children.attr("aria-hidden","true"),s.children.slice(t,t+e).attr("aria-hidden","false"))};return o.goToSlide=function(e,i){var n,r,a,l,d=!0,c=0,g={left:0,top:0},u=null;if(s.oldIndex=s.active.index,s.active.index=function(t){return t<0?s.settings.infiniteLoop?f()-1:s.active.index:t>=f()?s.settings.infiniteLoop?0:s.active.index:t}(e),!s.working&&s.active.index!==s.oldIndex){if(s.working=!0,void 0!==(d=s.settings.onSlideBefore.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index))&&!d)return s.active.index=s.oldIndex,void(s.working=!1);"next"===i?s.settings.onSlideNext.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1):"prev"===i&&(s.settings.onSlidePrev.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1)),s.active.last=s.active.index>=f()-1,(s.settings.pager||s.settings.pagerCustom)&&z(s.active.index),s.settings.controls&&D(),"fade"===s.settings.mode?(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),s.children.filter(":visible").fadeOut(s.settings.speed).css({zIndex:0}),s.children.eq(s.active.index).css("zIndex",s.settings.slideZIndex+1).fadeIn(s.settings.speed,(function(){t(this).css("zIndex",s.settings.slideZIndex),A()}))):(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),!s.settings.infiniteLoop&&s.carousel&&s.active.last?"horizontal"===s.settings.mode?(g=(u=s.children.eq(s.children.length-1)).position(),c=s.viewport.width()-u.outerWidth()):(n=s.children.length-s.settings.minSlides,g=s.children.eq(n).position()):s.carousel&&s.active.last&&"prev"===i?(r=1===s.settings.moveSlides?s.settings.maxSlides-x():(f()-1)*x()-(s.children.length-s.settings.maxSlides),g=(u=o.children(".bx-clone").eq(r)).position()):"next"===i&&0===s.active.index?(g=o.find("> .bx-clone").eq(s.settings.maxSlides).position(),s.active.last=!1):e>=0&&(l=e*parseInt(x()),g=s.children.eq(l).position()),void 0!==g&&(a="horizontal"===s.settings.mode?-(g.left-c):-g.top,S(a,"slide",s.settings.speed)),s.working=!1),s.settings.ariaHidden&&U(s.active.index*x())}},o.goToNextSlide=function(){if((s.settings.infiniteLoop||!s.active.last)&&!0!==s.working){var t=parseInt(s.active.index)+1;o.goToSlide(t,"next")}},o.goToPrevSlide=function(){if((s.settings.infiniteLoop||0!==s.active.index)&&!0!==s.working){var t=parseInt(s.active.index)-1;o.goToSlide(t,"prev")}},o.startAuto=function(t){s.interval||(s.interval=setInterval((function(){"next"===s.settings.autoDirection?o.goToNextSlide():o.goToPrevSlide()}),s.settings.pause),s.settings.onAutoChange.call(o,!0),s.settings.autoControls&&!0!==t&&q("stop"))},o.stopAuto=function(t){s.autoPaused&&(s.autoPaused=!1),s.interval&&(clearInterval(s.interval),s.interval=null,s.settings.onAutoChange.call(o,!1),s.settings.autoControls&&!0!==t&&q("start"))},o.getCurrentSlide=function(){return s.active.index},o.getCurrentSlideElement=function(){return s.children.eq(s.active.index)},o.getSlideElement=function(t){return s.children.eq(t)},o.getSlideCount=function(){return s.children.length},o.isWorking=function(){return s.working},o.redrawSlider=function(){s.children.add(o.find(".bx-clone")).outerWidth(h()),s.viewport.css("height",p()),s.settings.ticker||m(),s.active.last&&(s.active.index=f()-1),s.active.index>=f()&&(s.active.last=!0),s.settings.pager&&!s.settings.pagerCustom&&(w(),z(s.active.index)),s.settings.ariaHidden&&U(s.active.index*x())},o.destroySlider=function(){s.initialized&&(s.initialized=!1,t(".bx-clone",this).remove(),s.children.each((function(){void 0!==t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")})),void 0!==t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),s.controls.el&&s.controls.el.remove(),s.controls.next&&s.controls.next.remove(),s.controls.prev&&s.controls.prev.remove(),s.pagerEl&&s.settings.controls&&!s.settings.pagerCustom&&s.pagerEl.remove(),t(".bx-caption",this).remove(),s.controls.autoEl&&s.controls.autoEl.remove(),clearInterval(s.interval),s.settings.responsive&&t(window).off("resize",Z),s.settings.keyboardEnabled&&t(document).off("keydown",N),t(this).removeData("bxSlider"),t(window).off("blur",W).off("focus",H))},o.reloadSlider=function(e){void 0!==e&&(n=e),o.destroySlider(),l(),t(o).data("bxSlider",this)},l(),t(o).data("bxSlider",this),this}}}(jQuery); \ No newline at end of file