woocommerce/assets/js/flexslider/jquery.flexslider.min.js

1 line
22 KiB
JavaScript
Raw Normal View History

2018-08-30 16:56:26 +00:00
!function(b){var a=!0;b.flexslider=function(p,e){var m=b(p);"undefined"==typeof e.rtl&&"rtl"==b("html").attr("dir")&&(e.rtl=!0),m.vars=b.extend({},b.flexslider.defaults,e);var t,c=m.vars.namespace,f=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,u=("ontouchstart"in window||f||window.DocumentTouch&&document instanceof DocumentTouch)&&m.vars.touch,o="click touchend MSPointerUp keyup",l="",g="vertical"===m.vars.direction,h=m.vars.reverse,S=0<m.vars.itemWidth,x="fade"===m.vars.animation,v=""!==m.vars.asNavFor,y={};b.data(p,"flexslider",m),y={init:function(){m.animating=!1,m.currentSlide=parseInt(m.vars.startAt?m.vars.startAt:0,10),isNaN(m.currentSlide)&&(m.currentSlide=0),m.animatingTo=m.currentSlide,m.atEnd=0===m.currentSlide||m.currentSlide===m.last,m.containerSelector=m.vars.selector.substr(0,m.vars.selector.search(" ")),m.slides=b(m.vars.selector,m),m.container=b(m.containerSelector,m),m.count=m.slides.length,m.syncExists=0<b(m.vars.sync).length,"slide"===m.vars.animation&&(m.vars.animation="swing"),m.prop=g?"top":m.vars.rtl?"marginRight":"marginLeft",m.args={},m.manualPause=!1,m.stopped=!1,m.started=!1,m.startTimeout=null,m.transitions=!m.vars.video&&!x&&m.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(e.style[t[a]]!==undefined)return m.pfx=t[a].replace("Perspective","").toLowerCase(),m.prop="-"+m.pfx+"-transform",!0;return!1}(),m.isFirefox=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),(m.ensureAnimationEnd="")!==m.vars.controlsContainer&&(m.controlsContainer=0<b(m.vars.controlsContainer).length&&b(m.vars.controlsContainer)),""!==m.vars.manualControls&&(m.manualControls=0<b(m.vars.manualControls).length&&b(m.vars.manualControls)),""!==m.vars.customDirectionNav&&(m.customDirectionNav=2===b(m.vars.customDirectionNav).length&&b(m.vars.customDirectionNav)),m.vars.randomize&&(m.slides.sort(function(){return Math.round(Math.random())-.5}),m.container.empty().append(m.slides)),m.doMath(),m.setup("init"),m.vars.controlNav&&y.controlNav.setup(),m.vars.directionNav&&y.directionNav.setup(),m.vars.keyboard&&(1===b(m.containerSelector).length||m.vars.multipleKeyboard)&&b(document).bind("keyup",function(e){var t=e.keyCode;if(!m.animating&&(39===t||37===t)){var a=m.vars.rtl?37===t?m.getTarget("next"):39===t&&m.getTarget("prev"):39===t?m.getTarget("next"):37===t&&m.getTarget("prev");m.flexAnimate(a,m.vars.pauseOnAction)}}),m.vars.mousewheel&&m.bind("mousewheel",function(e,t,a,n){e.preventDefault();var i=t<0?m.getTarget("next"):m.getTarget("prev");m.flexAnimate(i,m.vars.pauseOnAction)}),m.vars.pausePlay&&y.pausePlay.setup(),m.vars.slideshow&&m.vars.pauseInvisible&&y.pauseInvisible.init(),m.vars.slideshow&&(m.vars.pauseOnHover&&m.hover(function(){m.manualPlay||m.manualPause||m.pause()},function(){m.manualPause||m.manualPlay||m.stopped||m.play()}),m.vars.pauseInvisible&&y.pauseInvisible.isHidden()||(0<m.vars.initDelay?m.startTimeout=setTimeout(m.play,m.vars.initDelay):m.play())),v&&y.asNav.setup(),u&&m.vars.touch&&y.touch(),(!x||x&&m.vars.smoothHeight)&&b(window).bind("resize orientationchange focus",y.resize),m.find("img").attr("draggable","false"),setTimeout(function(){m.vars.start(m)},200)},asNav:{setup:function(){m.asNav=!0,m.animatingTo=Math.floor(m.currentSlide/m.move),m.currentItem=m.currentSlide,m.slides.removeClass(c+"active-slide").eq(m.currentItem).addClass(c+"active-slide"),f?(p._slider=m).slides.each(function(){var e=this;e._gesture=new MSGesture,(e._gesture.target=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=b(this),a=t.index();b(m.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(m.direction=m.currentItem<a?"next":"prev",m.flexAnimate(a,m.vars.pauseOnAction,!1,!0,!0))})}):m.slides.on(o,function(e){e.preventDefault();var t=b(this),a=t.index();(m.vars.rtl?-1*(t.offset().right-b(m).s