bxsliderがPC版chromeでのみスワイプできない

javascript

1 6 7!function (t) {8 var e = {9 mode: "horizontal",10 slideSelector: "",11 infiniteLoop: !0,12 hideControlOnEnd: !1,13 speed: 500,14 easing: null,15 slideMargin: 0,16 startSlide: 0,17 randomStart: !1,18 captions: !1,19 ticker: !1,20 tickerHover: !1,21 adaptiveHeight: !1,22 adaptiveHeightSpeed: 500,23 video: !1,24 useCSS: !0,25 preloadImages: "all",26 responsive: !0,27 slideZIndex: 50,28 wrapperClass: "bx-wrapper",29 touchEnabled: !0,30 swipeThreshold: 20,31 oneToOneTouch: !0,32 preventDefaultSwipeX: !0,33 preventDefaultSwipeY: !1,34 ariaLive: !0,35 ariaHidden: !0,36 keyboardEnabled: !1,37 pager: !0,38 pagerType: "full",39 pagerShortSeparator: " / ",40 pagerSelector: null,41 buildPager: null,42 pagerCustom: null,43 controls: !0,44 nextText: "Next",45 prevText: "Prev",46 nextSelector: null,47 prevSelector: null,48 autoControls: !1,49 startText: "Start",50 stopText: "Stop",51 autoControlsCombine: !1,52 autoControlsSelector: null,53 auto: !1,54 pause: 4e3,55 autoStart: !0,56 autoDirection: "next",57 stopAutoOnClick: !1,58 autoHover: !1,59 autoDelay: 0,60 autoSlideForOnePage: !1,61 minSlides: 1,62 maxSlides: 1,63 moveSlides: 0,64 slideWidth: 0,65 shrinkItems: !1,66 onSliderLoad: function () { return !0 },67 onSlideBefore: function () { return !0 },68 onSlideAfter: function () { return !0 },69 onSlideNext: function () { return !0 },70 onSlidePrev: function () { return !0 },71 onSliderResize: function () { return !0 }72 };73 74//略75 76//文字数が多いためおそらくこの辺ではないか(bindしてるし)との部分を記載させていただきます。77 X = function (t) {78 if (s.controls.el.addClass("disabled"), s.working) t.preventDefault(),79 s.controls.el.removeClass("disabled");80 else {81 s.touch.originalPos = o.position();82 var e = t.originalEvent, i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e];83 s.touch.start.x = i[0].pageX,84 s.touch.start.y = i[0].pageY,85 s.viewport.get(0).setPointerCapture && (s.pointerId = e.pointerId, s.viewport.get(0).setPointerCapture(s.pointerId)),86 s.viewport.bind("touchmove MSPointerMove pointermove", V),87 s.viewport.bind("touchend MSPointerUp pointerup", R),88 s.viewport.bind("MSPointerCancel pointercancel", Y)89 }90 },91 Y = function (t) {92 S(s.touch.originalPos.left, "reset", 0),93 s.controls.el.removeClass("disabled"),94 s.viewport.unbind("MSPointerCancel pointercancel", Y),95 s.viewport.unbind("touchmove MSPointerMove pointermove", V),96 s.viewport.unbind("touchend MSPointerUp pointerup", R),97 s.viewport.get(0).releasePointerCapture && s.viewport.get(0).releasePointerCapture(s.pointerId)98 },99 V = function (t) {100 var e = t.originalEvent, i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e], n = Math.abs(i[0].pageX - s.touch.start.x),101 o = Math.abs(i[0].pageY - s.touch.start.y),102 r = 0,103 a = 0;104 3 * n > o && s.settings.preventDefaultSwipeX ? t.preventDefault() : 3 * o > n && s.settings.preventDefaultSwipeY && t.preventDefault(),105 "fade" !== s.settings.mode && s.settings.oneToOneTouch && ("horizontal" === s.settings.mode ? (a = i[0].pageX - s.touch.start.x,106 r = s.touch.originalPos.left + a) : (a = i[0].pageY - s.touch.start.y,107 r = s.touch.originalPos.top + a),108 S(r, "reset", 0))109 },110 R = function (t) {111 s.viewport.unbind("touchmove MSPointerMove pointermove", V),112 s.controls.el.removeClass("disabled");113 var e = t.originalEvent,114 i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e],115 n = 0,116 r = 0;117 s.touch.end.x = i[0].pageX,118 s.touch.end.y = i[0].pageY,119 "fade" === s.settings.mode ? (r = Math.abs(s.touch.start.x - s.touch.end.x),120 r >= s.settings.swipeThreshold && (s.touch.start.x > s.touch.end.x ? o.goToNextSlide() : o.goToPrevSlide()))121 : ("horizontal" === s.settings.mode ?122 (r = s.touch.end.x - s.touch.start.x, n = s.touch.originalPos.left)123 : (r = s.touch.end.y - s.touch.start.y, n = s.touch.originalPos.top),124 !s.settings.infiniteLoop && (0 === s.active.index && r > 0 || s.active.last && r < 0) ?125 S(n, "reset", 200)126 : Math.abs(r) >= s.settings.swipeThreshold ?127 (r < 0 ? o.goToNextSlide() : o.goToPrevSlide()) : S(n, "reset", 200));128 s.viewport.unbind("touchend MSPointerUp pointerup", R),129 s.viewport.get(0).releasePointerCapture && s.viewport.get(0).releasePointerCapture(s.pointerId)130 },131 132//略133 134 $('.bxslider').on('dragend', 'a', function (e) {135 isDragging = false;136 });137}(jQuery);

コメントを投稿

0 コメント