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

1 line
22 KiB
JavaScript
Raw Normal View History

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