You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
85 KiB
19 lines
85 KiB
7 years ago
|
/**
|
||
|
* Swiper 3.4.2
|
||
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
||
|
*
|
||
|
* http://www.idangero.us/swiper/
|
||
|
*
|
||
|
* Copyright 2017, Vladimir Kharlampidi
|
||
|
* The iDangero.us
|
||
|
* http://www.idangero.us/
|
||
|
*
|
||
|
* Licensed under MIT
|
||
|
*
|
||
|
* Released on: March 10, 2017
|
||
|
*/
|
||
|
!function(e,a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):e.Swiper=a(e.jQuery)}(this,function(e){"use strict";var a=function(t,s){function r(e){return Math.floor(e)}function i(){var e=y.params.autoplay,a=y.slides.eq(y.activeIndex);a.attr("data-swiper-autoplay")&&(e=a.attr("data-swiper-autoplay")||y.params.autoplay),y.autoplayTimeoutId=setTimeout(function(){y.params.loop?(y.fixLoop(),y._slideNext(),y.emit("onAutoplay",y)):y.isEnd?s.autoplayStopOnLast?y.stopAutoplay():(y._slideTo(0),y.emit("onAutoplay",y)):(y._slideNext(),y.emit("onAutoplay",y))},e)}function n(a,t){var s=e(a.target);if(!s.is(t))if("string"==typeof t)s=s.parents(t);else if(t.nodeType){var r;return s.parents().each(function(e,a){a===t&&(r=t)}),r?t:void 0}if(0!==s.length)return s[0]}function o(e,a){a=a||{};var t=window.MutationObserver||window.WebkitMutationObserver,s=new t(function(e){e.forEach(function(e){y.onResize(!0),y.emit("onObserverUpdate",y,e)})});s.observe(e,{attributes:void 0===a.attributes||a.attributes,childList:void 0===a.childList||a.childList,characterData:void 0===a.characterData||a.characterData}),y.observers.push(s)}function l(e){e.originalEvent&&(e=e.originalEvent);var a=e.keyCode||e.charCode;if(!y.params.allowSwipeToNext&&(y.isHorizontal()&&39===a||!y.isHorizontal()&&40===a))return!1;if(!y.params.allowSwipeToPrev&&(y.isHorizontal()&&37===a||!y.isHorizontal()&&38===a))return!1;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||document.activeElement&&document.activeElement.nodeName&&("input"===document.activeElement.nodeName.toLowerCase()||"textarea"===document.activeElement.nodeName.toLowerCase()))){if(37===a||39===a||38===a||40===a){var t=!1;if(y.container.parents("."+y.params.slideClass).length>0&&0===y.container.parents("."+y.params.slideActiveClass).length)return;var s={left:window.pageXOffset,top:window.pageYOffset},r=window.innerWidth,i=window.innerHeight,n=y.container.offset();y.rtl&&(n.left=n.left-y.container[0].scrollLeft);for(var o=[[n.left,n.top],[n.left+y.width,n.top],[n.left,n.top+y.height],[n.left+y.width,n.top+y.height]],l=0;l<o.length;l++){var p=o[l];p[0]>=s.left&&p[0]<=s.left+r&&p[1]>=s.top&&p[1]<=s.top+i&&(t=!0)}if(!t)return}y.isHorizontal()?(37!==a&&39!==a||(e.preventDefault?e.preventDefault():e.returnValue=!1),(39===a&&!y.rtl||37===a&&y.rtl)&&y.slideNext(),(37===a&&!y.rtl||39===a&&y.rtl)&&y.slidePrev()):(38!==a&&40!==a||(e.preventDefault?e.preventDefault():e.returnValue=!1),40===a&&y.slideNext(),38===a&&y.slidePrev()),y.emit("onKeyPress",y,a)}}function p(e){var a=0,t=0,s=0,r=0;return"detail"in e&&(t=e.detail),"wheelDelta"in e&&(t=-e.wheelDelta/120),"wheelDeltaY"in e&&(t=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(a=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(a=t,t=0),s=10*a,r=10*t,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(s=e.deltaX),(s||r)&&e.deltaMode&&(1===e.deltaMode?(s*=40,r*=40):(s*=800,r*=800)),s&&!a&&(a=s<1?-1:1),r&&!t&&(t=r<1?-1:1),{spinX:a,spinY:t,pixelX:s,pixelY:r}}function d(e){e.originalEvent&&(e=e.originalEvent);var a=0,t=y.rtl?-1:1,s=p(e);if(y.params.mousewheelForceToAxis)if(y.isHorizontal()){if(!(Math.abs(s.pixelX)>Math.abs(s.pixelY)))return;a=s.pixelX*t}else{if(!(Math.abs(s.pixelY)>Math.abs(s.pixelX)))return;a=s.pixelY}else a=Math.abs(s.pixelX)>Math.abs(s.pixelY)?-s.pixelX*t:-s.pixelY;if(0!==a){if(y.params.mousewheelInvert&&(a=-a),y.params.freeMode){var r=y.getWrapperTranslate()+a*y.params.mousewheelSensitivity,i=y.isBeginning,n=y.isEnd;if(r>=y.minTranslate()&&(r=y.minTranslate()),r<=y.maxTranslate()&&(r=y.maxTranslate()),y.setWrapperTransition(0),y.setWrapperTranslate(r),y.updateProgress(),y.updateActiveIndex(),(!i&&y.isBeginning||!n&&y.isEnd)&&y.updateClasses(),y.params.freeModeSticky?(clearTimeout(y.mousewheel.timeout),y.mousewheel.timeout=setTimeout(function(){y.slideReset()},300)):y.params.lazyLoading&&y.lazy&&y.lazy.load(),y.emit("onScroll",y,e),y.params.autoplay&&y.params.autoplayDisableOnInteraction&&y.stopAutoplay(),0===r||r===y.maxTranslate())return}else{if((new window.Date).getTime()-y.mouse
|
||
|
y.onClickPrev=function(e){e.preventDefault(),y.isBeginning&&!y.params.loop||y.slidePrev()},y.onClickIndex=function(a){a.preventDefault();var t=e(this).index()*y.params.slidesPerGroup;y.params.loop&&(t+=y.loopedSlides),y.slideTo(t)},y.updateClickedSlide=function(a){var t=n(a,"."+y.params.slideClass),s=!1;if(t)for(var r=0;r<y.slides.length;r++)y.slides[r]===t&&(s=!0);if(!t||!s)return y.clickedSlide=void 0,void(y.clickedIndex=void 0);if(y.clickedSlide=t,y.clickedIndex=e(t).index(),y.params.slideToClickedSlide&&void 0!==y.clickedIndex&&y.clickedIndex!==y.activeIndex){var i,o=y.clickedIndex,l="auto"===y.params.slidesPerView?y.currentSlidesPerView():y.params.slidesPerView;if(y.params.loop){if(y.animating)return;i=parseInt(e(y.clickedSlide).attr("data-swiper-slide-index"),10),y.params.centeredSlides?o<y.loopedSlides-l/2||o>y.slides.length-y.loopedSlides+l/2?(y.fixLoop(),o=y.wrapper.children("."+y.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.'+y.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){y.slideTo(o)},0)):y.slideTo(o):o>y.slides.length-l?(y.fixLoop(),o=y.wrapper.children("."+y.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.'+y.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){y.slideTo(o)},0)):y.slideTo(o)}else y.slideTo(o)}};var b,C,S,z,M,P,E,I,k,D,L="input, select, textarea, button, video",B=Date.now(),H=[];y.animating=!1,y.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};var G,X;y.onTouchStart=function(a){if(a.originalEvent&&(a=a.originalEvent),(G="touchstart"===a.type)||!("which"in a)||3!==a.which){if(y.params.noSwiping&&n(a,"."+y.params.noSwipingClass))return void(y.allowClick=!0);if(!y.params.swipeHandler||n(a,y.params.swipeHandler)){var t=y.touches.currentX="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,s=y.touches.currentY="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY;if(!(y.device.ios&&y.params.iOSEdgeSwipeDetection&&t<=y.params.iOSEdgeSwipeThreshold)){if(b=!0,C=!1,S=!0,M=void 0,X=void 0,y.touches.startX=t,y.touches.startY=s,z=Date.now(),y.allowClick=!0,y.updateContainerSize(),y.swipeDirection=void 0,y.params.threshold>0&&(I=!1),"touchstart"!==a.type){var r=!0;e(a.target).is(L)&&(r=!1),document.activeElement&&e(document.activeElement).is(L)&&document.activeElement.blur(),r&&a.preventDefault()}y.emit("onTouchStart",y,a)}}}},y.onTouchMove=function(a){if(a.originalEvent&&(a=a.originalEvent),!G||"mousemove"!==a.type){if(a.preventedByNestedSwiper)return y.touches.startX="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,void(y.touches.startY="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY);if(y.params.onlyExternal)return y.allowClick=!1,void(b&&(y.touches.startX=y.touches.currentX="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,y.touches.startY=y.touches.currentY="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY,z=Date.now()));if(G&&y.params.touchReleaseOnEdges&&!y.params.loop)if(y.isHorizontal()){if(y.touches.currentX<y.touches.startX&&y.translate<=y.maxTranslate()||y.touches.currentX>y.touches.startX&&y.translate>=y.minTranslate())return}else if(y.touches.currentY<y.touches.startY&&y.translate<=y.maxTranslate()||y.touches.currentY>y.touches.startY&&y.translate>=y.minTranslate())return;if(G&&document.activeElement&&a.target===document.activeElement&&e(a.target).is(L))return C=!0,void(y.allowClick=!1);if(S&&y.emit("onTouchMove",y,a),!(a.targetTouches&&a.targetTouches.length>1)){if(y.touches.currentX="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,y.touches.currentY="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY,void 0===M){var t;y.isHorizontal()&&y.touches.currentY===y.touches.startY||!y.isHorizontal()&&y.touches.currentX===y.touches.startX?M=!1:(t=180*Math.atan2(Math.abs(y.touches.currentY-y.touches.startY),Math.abs(y.touches.currentX-y.touches.startX))/Math.PI,M=y.isHorizontal()?t>y.params.touchAngle:90-t>y.params.touchAngle)}if(M&&y.emit("onTouchMoveOpposite",y,a),void 0===X&&(y.touches.currentX===y.touches.startX&&y.touches.currentY===y.touches.startY||(X=!0)),b){if(M)return void(b=!1);if(X){y.allo
|
||
|
;t!==y.slides.eq(y.activeIndex).attr("data-hash")&&y.slideTo(y.wrapper.children("."+y.params.slideClass+'[data-hash="'+t+'"]').index())},attachEvents:function(a){var t=a?"off":"on";e(window)[t]("hashchange",y.hashnav.onHashCange)},setHash:function(){if(y.hashnav.initialized&&y.params.hashnav)if(y.params.replaceState&&window.history&&window.history.replaceState)window.history.replaceState(null,null,"#"+y.slides.eq(y.activeIndex).attr("data-hash")||"");else{var e=y.slides.eq(y.activeIndex),a=e.attr("data-hash")||e.attr("data-history");document.location.hash=a||""}},init:function(){if(y.params.hashnav&&!y.params.history){y.hashnav.initialized=!0;var e=document.location.hash.replace("#","");if(e)for(var a=0,t=y.slides.length;a<t;a++){var s=y.slides.eq(a),r=s.attr("data-hash")||s.attr("data-history");if(r===e&&!s.hasClass(y.params.slideDuplicateClass)){var i=s.index();y.slideTo(i,0,y.params.runCallbacksOnInit,!0)}}y.params.hashnavWatchState&&y.hashnav.attachEvents()}},destroy:function(){y.params.hashnavWatchState&&y.hashnav.attachEvents(!0)}},y.history={init:function(){if(y.params.history){if(!window.history||!window.history.pushState)return y.params.history=!1,void(y.params.hashnav=!0);y.history.initialized=!0,this.paths=this.getPathValues(),(this.paths.key||this.paths.value)&&(this.scrollToSlide(0,this.paths.value,y.params.runCallbacksOnInit),y.params.replaceState||window.addEventListener("popstate",this.setHistoryPopState))}},setHistoryPopState:function(){y.history.paths=y.history.getPathValues(),y.history.scrollToSlide(y.params.speed,y.history.paths.value,!1)},getPathValues:function(){var e=window.location.pathname.slice(1).split("/"),a=e.length;return{key:e[a-2],value:e[a-1]}},setHistory:function(e,a){if(y.history.initialized&&y.params.history){var t=y.slides.eq(a),s=this.slugify(t.attr("data-history"));window.location.pathname.includes(e)||(s=e+"/"+s),y.params.replaceState?window.history.replaceState(null,null,s):window.history.pushState(null,null,s)}},slugify:function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(e,a,t){if(a)for(var s=0,r=y.slides.length;s<r;s++){var i=y.slides.eq(s),n=this.slugify(i.attr("data-history"));if(n===a&&!i.hasClass(y.params.slideDuplicateClass)){var o=i.index();y.slideTo(o,e,t)}}else y.slideTo(0,e,t)}},y.disableKeyboardControl=function(){y.params.keyboardControl=!1,e(document).off("keydown",l)},y.enableKeyboardControl=function(){y.params.keyboardControl=!0,e(document).on("keydown",l)},y.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()},y.params.mousewheelControl&&(y.mousewheel.event=navigator.userAgent.indexOf("firefox")>-1?"DOMMouseScroll":function(){var e="onwheel"in document;if(!e){var a=document.createElement("div");a.setAttribute("onwheel","return;"),e="function"==typeof a.onwheel}return!e&&document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0&&(e=document.implementation.hasFeature("Events.wheel","3.0")),e}()?"wheel":"mousewheel"),y.disableMousewheelControl=function(){if(!y.mousewheel.event)return!1;var a=y.container;return"container"!==y.params.mousewheelEventsTarged&&(a=e(y.params.mousewheelEventsTarged)),a.off(y.mousewheel.event,d),y.params.mousewheelControl=!1,!0},y.enableMousewheelControl=function(){if(!y.mousewheel.event)return!1;var a=y.container;return"container"!==y.params.mousewheelEventsTarged&&(a=e(y.params.mousewheelEventsTarged)),a.on(y.mousewheel.event,d),y.params.mousewheelControl=!0,!0},y.parallax={setTranslate:function(){y.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){u(this,y.progress)}),y.slides.each(function(){var a=e(this);a.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){u(this,Math.min(Math.max(a[0].progress,-1),1))})})},setTransition:function(a){void 0===a&&(a=y.params.speed),y.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parall
|
||
|
//# sourceMappingURL=maps/swiper.jquery.umd.min.js.map
|