Advertisement
Guest User

Untitled

a guest
Dec 5th, 2015
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*! enscroll - v0.6.1 - 2014-09-01
  2.  * Copyright (c) 2014 ; Licensed  */
  3. ! function(a, b, c, d) {
  4.     var e = {
  5.             verticalScrolling: !0,
  6.             horizontalScrolling: !1,
  7.             verticalScrollerSide: "right",
  8.             showOnHover: !1,
  9.             scrollIncrement: 20,
  10.             minScrollbarLength: 40,
  11.             pollChanges: !0,
  12.             drawCorner: !0,
  13.             drawScrollButtons: !1,
  14.             clickTrackToScroll: !0,
  15.             easingDuration: 500,
  16.             propagateWheelEvent: !0,
  17.             verticalTrackClass: "vertical-track",
  18.             horizontalTrackClass: "horizontal-track",
  19.             horizontalHandleClass: "horizontal-handle",
  20.             verticalHandleClass: "vertical-handle",
  21.             scrollUpButtonClass: "scroll-up-btn",
  22.             scrollDownButtonClass: "scroll-down-btn",
  23.             scrollLeftButtonClass: "scroll-left-btn",
  24.             scrollRightButtonClass: "scroll-right-btn",
  25.             cornerClass: "scrollbar-corner",
  26.             zIndex: 1,
  27.             addPaddingToPane: !0,
  28.             horizontalHandleHTML: '<div class="left"></div><div class="right"></div>',
  29.             verticalHandleHTML: '<div class="top"></div><div class="bottom"></div>'
  30.         },
  31.         f = function(a) {
  32.             a.preventDefault ? a.preventDefault() : a.returnValue = !1, a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0
  33.         },
  34.         g = b.requestAnimationFrame || b.mozRequestAnimationFrame || b.webkitRequestAnimationFrame || b.oRequestAnimationFrame || b.msRequestAnimationFrame || function(a) {
  35.             setTimeout(a, 17)
  36.         },
  37.         h = function(b, c) {
  38.             var d = a(b).css(c),
  39.                 e = /^-?\d+/.exec(d);
  40.             return e ? +e[0] : 0
  41.         },
  42.         i = function(a) {
  43.             var b, c, d = {
  44.                     width: "5px",
  45.                     height: "1px",
  46.                     overflow: "hidden",
  47.                     padding: "8px 0",
  48.                     visibility: "hidden",
  49.                     whiteSpace: "pre-line",
  50.                     font: "10px/1 serif"
  51.                 },
  52.                 e = document.createElement(a),
  53.                 f = document.createTextNode("a\na");
  54.             for (c in d) e.style[c] = d[c];
  55.             return e.appendChild(f), document.body.appendChild(e), b = e.scrollHeight < 28, document.body.removeChild(e), b
  56.         },
  57.         j = .5 * Math.PI,
  58.         k = 10 * Math.log(2),
  59.         l = function(a, b, c) {
  60.             var d = j / b,
  61.                 e = a * d;
  62.             return Math.round(e * Math.cos(d * c))
  63.         },
  64.         m = function(a, b, c) {
  65.             return Math.round(a * k * Math.pow(2, -10 * c / b + 1) / b)
  66.         },
  67.         n = function(a, b, c, d) {
  68.             return 2 * c / Math.PI * Math.asin((d - a) / b)
  69.         },
  70.         o = function(b) {
  71.             var c = a(this).data("enscroll"),
  72.                 d = this,
  73.                 e = c.settings,
  74.                 f = function() {
  75.                     var b = a(this).data("enscroll"),
  76.                         c = b.settings;
  77.                     b && c.showOnHover && (c.verticalScrolling && a(b.verticalTrackWrapper).is(":visible") && a(b.verticalTrackWrapper).stop().fadeTo(275, 0), c.horizontalScrolling && a(b.horizontalTrackWrapper).is(":visible") && a(b.horizontalTrackWrapper).stop().fadeTo(275, 0), b._fadeTimer = null)
  78.                 };
  79.             c && e.showOnHover && (c._fadeTimer ? clearTimeout(c._fadeTimer) : (e.verticalScrolling && a(c.verticalTrackWrapper).is(":visible") && a(c.verticalTrackWrapper).stop().fadeTo(275, 1), e.horizontalScrolling && a(c.horizontalTrackWrapper).is(":visible") && a(c.horizontalTrackWrapper).stop().fadeTo(275, 1)), b !== !1 && (c._fadeTimer = setTimeout(function() {
  80.                 f.call(d)
  81.             }, 1750)))
  82.         },
  83.         p = function(b, c) {
  84.             var d = a(b),
  85.                 e = d.data("enscroll"),
  86.                 f = d.scrollTop();
  87.             e && e.settings.verticalScrolling && (d.scrollTop(f + c), e.settings.showOnHover && o.call(b))
  88.         },
  89.         q = function(b, c) {
  90.             var d = a(b),
  91.                 e = d.data("enscroll"),
  92.                 f = d.scrollLeft();
  93.             e && e.settings.horizontalScrolling && (d.scrollLeft(f + c), e.settings.showOnHover && o.call(b))
  94.         },
  95.         r = function(b) {
  96.             if (1 === b.which) {
  97.                 var d, e, f, h, i, j, k, l, m, n = b.data.pane,
  98.                     p = a(n),
  99.                     q = p.data("enscroll"),
  100.                     r = !0,
  101.                     s = function() {
  102.                         r && (f !== h && (q._scrollingY || (q._scrollingY = !0, q._startY = p.scrollTop(), g(function() {
  103.                             t(p)
  104.                         })), e.style.top = f + "px", q._endY = f * m / l, h = f), g(s), q.settings.showOnHover && o.call(n))
  105.                     },
  106.                     u = function(a) {
  107.                         return r && (f = a.clientY - j - i, f = Math.min(0 > f ? 0 : f, l)), !1
  108.                     },
  109.                     v = function() {
  110.                         return r = !1, c.body.style.cursor = k, this.style.cursor = "", d.removeClass("dragging"), a(c.body).off("mousemove.enscroll.vertical").off("mouseup.enscroll.vertical"), a(c).off("mouseout.enscroll.vertical"), p.on("scroll.enscroll.pane", function(a) {
  111.                             x.call(this, a)
  112.                         }), !1
  113.                     };
  114.                 return d = a(q.verticalTrackWrapper).find(".enscroll-track"), e = d.children().first()[0], f = parseInt(e.style.top, 10), m = n.scrollHeight - (q._scrollHeightNoPadding ? a(n).height() : a(n).innerHeight()), i = b.clientY - a(e).offset().top, l = d.height() - a(e).outerHeight(), j = d.offset().top, p.off("scroll.enscroll.pane"), a(c.body).on({
  115.                     "mousemove.enscroll.vertical": u,
  116.                     "mouseup.enscroll.vertical": function(a) {
  117.                         v.call(e, a)
  118.                     }
  119.                 }), a(c).on("mouseout.enscroll.vertical", function(a) {
  120.                     a.target.nodeName && "HTML" === a.target.nodeName.toUpperCase() && v.call(e, a)
  121.                 }), d.hasClass("dragging") || (d.addClass("dragging"), k = a(c.body).css("cursor"), this.style.cursor = c.body.style.cursor = "ns-resize"), g(s), !1
  122.             }
  123.         },
  124.         s = function(b) {
  125.             if (1 === b.which) {
  126.                 var d, e, f, h, i, j, k, l, m, n = b.data.pane,
  127.                     p = a(n),
  128.                     q = a(n).data("enscroll"),
  129.                     r = !0,
  130.                     s = function() {
  131.                         r && (f !== h && (q._scrollingX || (q._scrollingX = !0, q._startX = p.scrollLeft(), g(function() {
  132.                             t(p)
  133.                         })), e.style.left = f + "px", q._endX = f * i / m, h = f), g(s), q.settings.showOnHover && o.call(n))
  134.                     },
  135.                     u = function(a) {
  136.                         return r && (f = a.clientX - k - j, f = Math.min(0 > f ? 0 : f, m)), !1
  137.                     },
  138.                     v = function() {
  139.                         return r = !1, d.removeClass("dragging"), c.body.style.cursor = l, this.style.cursor = "", d.removeClass("dragging"), a(c.body).off("mousemove.enscroll.horizontal").off("mouseup.enscroll.horizontal"), a(c).off("mouseout.enscroll.horizontal"), p.on("scroll.enscroll.pane", function(a) {
  140.                             x.call(this, a)
  141.                         }), !1
  142.                     };
  143.                 return d = a(q.horizontalTrackWrapper).find(".enscroll-track"), e = d.children().first()[0], f = parseInt(e.style.left, 10), i = n.scrollWidth - a(n).innerWidth(), j = b.clientX - a(e).offset().left, m = d.width() - a(e).outerWidth(), k = d.offset().left, p.off("scroll.enscroll.pane"), a(c.body).on({
  144.                     "mousemove.enscroll.horizontal": u,
  145.                     "mouseup.enscroll.horizontal": function(a) {
  146.                         v.call(e, a)
  147.                     }
  148.                 }), a(c).on("mouseout.enscroll.horizontal", function(a) {
  149.                     a.target.nodeName && "HTML" === a.target.nodeName.toUpperCase() && v.call(e, a)
  150.                 }), d.hasClass("dragging") || (d.addClass("dragging"), l = a("body").css("cursor"), this.style.cursor = c.body.style.cursor = "ew-resize"), g(s), !1
  151.             }
  152.         },
  153.         t = function(a) {
  154.             var b, c, d, e = a.data("enscroll"),
  155.                 f = e._duration;
  156.             e._scrollingX === !0 && (b = e._endX - e._startX, 0 === b ? e._scrollingX = !1 : (c = a.scrollLeft(), d = n(e._startX, b, f, c), b > 0 ? c >= e._endX || c < e._startX ? e._scrollingX = !1 : (q(a, Math.max(1, l(b, f, d))), g(function() {
  157.                 t(a)
  158.             })) : c <= e._endX || c > e._startX ? e._scrollingX = !1 : (q(a, Math.min(-1, l(b, f, d))), g(function() {
  159.                 t(a)
  160.             })))), e._scrollingY === !0 && (b = e._endY - e._startY, 0 === b ? e._scrollingY = !1 : (c = a.scrollTop(), d = n(e._startY, b, f, c), b > 0 ? c >= e._endY || c < e._startY ? e._scrollingY = !1 : (p(a, Math.max(1, l(b, f, d))), g(function() {
  161.                 t(a)
  162.             })) : c <= e._endY || c > e._startY ? e._scrollingY = !1 : (p(a, Math.min(-1, l(b, f, d))), g(function() {
  163.                 t(a)
  164.             }))))
  165.         },
  166.         u = function(a, b) {
  167.             var c = a.data("enscroll"),
  168.                 d = a.scrollLeft(),
  169.                 e = a[0].scrollWidth - a.innerWidth();
  170.             return !c.settings.horizontalScrolling || c._scrollingY ? !1 : (c._scrollingX || (c._scrollingX = !0, c._startX = d, c._endX = c._startX, g(function() {
  171.                 t(a)
  172.             })), c._endX = b > 0 ? Math.min(d + b, e) : Math.max(0, d + b), 0 > b && d > 0 || b > 0 && e > d)
  173.         },
  174.         v = function(a, b) {
  175.             var c = a.data("enscroll"),
  176.                 d = a.scrollTop(),
  177.                 e = a[0].scrollHeight - (c._scrollHeightNoPadding ? a.height() : a.innerHeight());
  178.             return !c.settings.verticalScrolling || c._scrollingX ? !1 : (c._scrollingY || (c._scrollingY = !0, c._startY = d, c._endY = c._startY, g(function() {
  179.                 t(a)
  180.             })), c._endY = b > 0 ? Math.min(d + b, e) : Math.max(0, d + b), 0 > b && d > 0 || b > 0 && e > d)
  181.         },
  182.         w = function(b) {
  183.             var c, d = a(this),
  184.                 e = d.data("enscroll"),
  185.                 g = e.settings.scrollIncrement,
  186.                 h = "deltaX" in b ? -b.deltaX : "wheelDeltaX" in b ? b.wheelDeltaX : 0,
  187.                 i = "deltaY" in b ? -b.deltaY : "wheelDeltaY" in b ? b.wheelDeltaY : "wheelDelta" in b ? b.wheelDelta : 0;
  188.             Math.abs(h) > Math.abs(i) ? (c = (h > 0 ? -g : g) << 2, (u(d, c) || !e.settings.propagateWheelEvent) && f(b)) : (c = (i > 0 ? -g : g) << 2, (v(d, c) || !e.settings.propagateWheelEvent) && f(b))
  189.         },
  190.         x = function() {
  191.             var b, c, d, e = a(this),
  192.                 f = e.data("enscroll");
  193.             f && (f.settings.verticalScrolling && (c = a(f.verticalTrackWrapper).find(".enscroll-track")[0], b = c.firstChild, d = e.scrollTop() / (this.scrollHeight - (f._scrollHeightNoPadding ? e.height() : e.innerHeight())), d = isNaN(d) ? 0 : d, b.style.top = d * (a(c).height() - a(b).outerHeight()) + "px"), f.settings.horizontalScrolling && (c = a(f.horizontalTrackWrapper).find(".enscroll-track")[0], b = c.firstChild, d = e.scrollLeft() / (this.scrollWidth - e.innerWidth()), d = isNaN(d) ? 0 : d, b.style.left = d * (a(c).width() - a(b).innerWidth()) + "px"))
  194.         },
  195.         y = function(b) {
  196.             var c, d = a(this),
  197.                 e = d.data("enscroll");
  198.             if (!/(input)|(select)|(textarea)/i.test(this.nodeName) && b.target === this && e) {
  199.                 switch (c = e.settings.scrollIncrement, b.keyCode) {
  200.                     case 32:
  201.                     case 34:
  202.                         return v(d, d.height()), !1;
  203.                     case 33:
  204.                         return v(d, -d.height()), !1;
  205.                     case 35:
  206.                         return v(d, this.scrollHeight), !1;
  207.                     case 36:
  208.                         return v(d, -this.scrollHeight), !1;
  209.                     case 37:
  210.                         return u(d, -c), !1;
  211.                     case 38:
  212.                         return v(d, -c), !1;
  213.                     case 39:
  214.                         return u(d, c), !1;
  215.                     case 40:
  216.                         return v(d, c), !1
  217.                 }
  218.                 return !0
  219.             }
  220.         },
  221.         z = function() {
  222.             var b = this,
  223.                 d = a(b).data("enscroll").settings,
  224.                 e = !0,
  225.                 f = 0,
  226.                 h = 0,
  227.                 i = a(b).offset().top,
  228.                 j = i + a(b).outerHeight(),
  229.                 k = a(b).offset().left,
  230.                 l = k + a(b).outerWidth(),
  231.                 m = function(a) {
  232.                     var b = a.pageX,
  233.                         c = a.pageY;
  234.                     f = k > b ? b - k : b > l ? b - l : 0, h = i > c ? c - i : c > j ? c - j : 0
  235.                 },
  236.                 n = function() {
  237.                     d.horizontalScrolling && f && q(b, parseInt(f / 4, 10)), d.verticalScrolling && h && p(b, parseInt(h / 4, 10)), e && g(n)
  238.                 },
  239.                 o = function() {
  240.                     e = !1, a(c).off("mousemove.enscroll.pane").off("mouseup.enscroll.pane")
  241.                 };
  242.             g(n), a(c).on({
  243.                 "mousemove.enscroll.pane": m,
  244.                 "mouseup.enscroll.pane": o
  245.             })
  246.         },
  247.         A = function(a) {
  248.             var b, c, e, h, i, j, k, l = this,
  249.                 n = function(a) {
  250.                     b = a.touches[0].clientX, c = a.touches[0].clientY, e || (e = c === i && b === h ? d : Math.abs(i - c) > Math.abs(h - b) ? "y" : "x"), f(a)
  251.                 },
  252.                 o = function() {
  253.                     j && ("y" === e ? (p(l, i - c), k = i - c, i = c) : "x" === e && (q(l, h - b), k = h - b, h = b), g(o))
  254.                 },
  255.                 r = function() {
  256.                     var a = 0,
  257.                         b = Math.abs(1.5 * k);
  258.                     this.removeEventListener("touchmove", n, !1), this.removeEventListener("touchend", r, !1), j = !1, g(function c() {
  259.                         var d;
  260.                         a === b || j || (d = m(k, b, a), isNaN(d) || 0 === d || (a += 1, "y" === e ? p(l, d) : q(l, d), g(c)))
  261.                     })
  262.                 };
  263.             1 === a.touches.length && (h = a.touches[0].clientX, i = a.touches[0].clientY, j = !0, this.addEventListener("touchmove", n, !1), this.addEventListener("touchend", r, !1), g(o))
  264.         },
  265.         B = {
  266.             reposition: function() {
  267.                 return this.each(function() {
  268.                     var b, c, d, e = a(this),
  269.                         f = e.data("enscroll"),
  270.                         g = function(a, b, c) {
  271.                             a.style.left = b + "px", a.style.top = c + "px"
  272.                         };
  273.                     f && (d = e.position(), b = f.corner, f.settings.verticalScrolling && (c = f.verticalTrackWrapper, g(c, "right" === f.settings.verticalScrollerSide ? d.left + e.outerWidth() - a(c).width() - h(this, "border-right-width") : d.left + h(this, "border-left-width"), d.top + h(this, "border-top-width"))), f.settings.horizontalScrolling && (c = f.horizontalTrackWrapper, g(c, d.left + h(this, "border-left-width"), d.top + e.outerHeight() - a(c).height() - h(this, "border-bottom-width"))), b && g(b, d.left + e.outerWidth() - a(b).outerWidth() - h(this, "border-right-width"), d.top + e.outerHeight() - a(b).outerHeight() - h(this, "border-bottom-width")))
  274.                 })
  275.             },
  276.             resize: function() {
  277.                 return this.each(function() {
  278.                     var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r = a(this),
  279.                         s = r.data("enscroll");
  280.                     return s ? (b = s.settings, void(r.is(":visible") ? (b.verticalScrolling && (e = s.verticalTrackWrapper, c = r.innerHeight(), f = c / this.scrollHeight, g = a(e).find(".enscroll-track")[0], j = a(e).find("." + b.scrollUpButtonClass), k = a(e).find("." + b.scrollDownButtonClass), i = b.horizontalScrolling ? c - a(s.horizontalTrackWrapper).find(".enscroll-track").outerHeight() : c, i -= a(g).outerHeight() - a(g).height() + j.outerHeight() + k.outerHeight(), n = g.firstChild, p = Math.max(f * i, b.minScrollbarLength), p -= a(n).outerHeight() - a(n).height(), e.style.display = "none", g.style.height = i + "px", n.style.height = p + "px", 1 > f && (f = r.scrollTop() / (this.scrollHeight - r.height()), n.style.top = f * (i - p) + "px", e.style.display = "block")), b.horizontalScrolling && (e = s.horizontalTrackWrapper, d = r.innerWidth(), f = d / this.scrollWidth, g = a(e).find(".enscroll-track")[0], l = a(e).find("." + b.scrollLeftButtonClass), m = a(e).find("." + b.scrollRightButtonClass), h = b.verticalScrolling ? d - a(s.verticalTrackWrapper).find(".enscroll-track").outerWidth() : d, h -= a(g).outerWidth() - a(g).width() + l.outerWidth() + m.outerWidth(), n = g.firstChild, o = Math.max(f * h, b.minScrollbarLength), o -= a(n).outerWidth() - a(n).width(), e.style.display = "none", g.style.width = h + "px", n.style.width = o + "px", 1 > f && (f = r.scrollLeft() / (this.scrollWidth - r.width()), n.style.left = f * (h - o) + "px", e.style.display = "block"), s._prybar && (q = s._prybar, this.removeChild(q), b.verticalScrolling && (q.style.width = this.scrollWidth + a(s.verticalTrackWrapper).find(".enscroll-track").outerWidth() + "px", this.appendChild(q)))), s.corner && (s.corner.style.display = s.verticalTrackWrapper && s.horizontalTrackWrapper && a(s.verticalTrackWrapper).is(":visible") && a(s.horizontalTrackWrapper).is(":visible") ? "" : "none")) : (b.verticalScrolling && (s.verticalTrackWrapper.style.display = "none"), b.horizontalScrolling && (s.horizontalTrackWrapper.style.display = "none"), s.corner && (s.corner.style.display = "none")))) : !0
  281.                 })
  282.             },
  283.             startPolling: function() {
  284.                 return this.each(function() {
  285.                     var b, c = a(this).data("enscroll"),
  286.                         d = this,
  287.                         e = a(d),
  288.                         f = -1,
  289.                         g = -1,
  290.                         h = -1,
  291.                         i = -1,
  292.                         j = function() {
  293.                             if (c.settings.pollChanges) {
  294.                                 var a = d.scrollWidth,
  295.                                     k = d.scrollHeight,
  296.                                     l = e.width(),
  297.                                     m = e.height(),
  298.                                     n = e.offset();
  299.                                 (c.settings.verticalScrolling && (m !== g || k !== i) || c.settings.horizontalScrolling && (l !== f || a !== h)) && (h = a, i = k, B.resize.call(e)), (b.left !== n.left || b.top !== n.top || l !== f || m !== g) && (b = n, f = l, g = m, B.reposition.call(e)), setTimeout(j, 350)
  300.                             }
  301.                         };
  302.                     c && (c.settings.pollChanges = !0, i = d.scrollHeight, h = d.scrollWidth, b = e.offset(), j())
  303.                 })
  304.             },
  305.             stopPolling: function() {
  306.                 return this.each(function() {
  307.                     var b = a(this).data("enscroll");
  308.                     b && (b.settings.pollChanges = !1)
  309.                 })
  310.             },
  311.             destroy: function() {
  312.                 return this.each(function() {
  313.                     var c, d, e = a(this),
  314.                         f = e.data("enscroll");
  315.                     f && (B.stopPolling.call(e), d = f._mouseScrollHandler, f.settings.verticalScrolling && (c = f.verticalTrackWrapper, a(c).remove(), c = null), f.settings.horizontalScrolling && (c = f.horizontalTrackWrapper, a(c).remove(), c = null), f._fadeTimer && clearTimeout(f._fadeTimer), f.corner && a(f.corner).remove(), f._prybar && f._prybar.parentNode && f._prybar.parentNode === this && a(f._prybar).remove(), this.setAttribute("style", f._style || ""), f._hadTabIndex || e.removeAttr("tabindex"), e.off("scroll.enscroll.pane").off("keydown.enscroll.pane").off("mouseenter.enscroll.pane").off("mousedown.enscroll.pane").data("enscroll", null), this.removeEventListener ? (this.removeEventListener("wheel", d, !1), this.removeEventListener("mousewheel", d, !1), this.removeEventListener("touchstart", A, !1)) : this.detachEvent && this.detachEvent("onmousewheel", d), a(b).off("resize.enscroll.window"))
  316.                 })
  317.             }
  318.         };
  319.     a.fn.enscroll = function(d) {
  320.         var f;
  321.         return B[d] ? B[d].call(this) : (f = a.extend({}, e, d), this.each(function() {
  322.             if (f.verticalScrolling || f.horizontalScrolling) {
  323.                 var d, e, g, j, k, l, m, n, t, C, D, E, F, G, H, I, J, K, L = a(this),
  324.                     M = this,
  325.                     N = L.attr("style"),
  326.                     O = !0,
  327.                     P = {
  328.                         position: "absolute",
  329.                         "z-index": f.zIndex,
  330.                         margin: 0,
  331.                         padding: 0
  332.                     },
  333.                     Q = function(a) {
  334.                         w.call(M, a)
  335.                     },
  336.                     R = function(b, c) {
  337.                         "string" == typeof c ? a(b).html(c) : b.appendChild(c)
  338.                     };
  339.                 if (f.verticalScrolling) {
  340.                     e = c.createElement("div"), j = c.createElement("div"), l = c.createElement("a"), a(j).css("position", "relative").addClass("enscroll-track").addClass(f.verticalTrackClass).appendTo(e), f.drawScrollButtons && (m = c.createElement("a"), n = c.createElement("a"), a(m).css({
  341.                         display: "block",
  342.                         "text-decoration": "none"
  343.                     }).attr("href", "").html("&nbsp;").addClass(f.scrollUpButtonClass).on("click", function() {
  344.                         return p(M, -f.scrollIncrement), !1
  345.                     }).insertBefore(j), a(n).css({
  346.                         display: "block",
  347.                         "text-decoration": "none"
  348.                     }).attr("href", "").html("&nbsp;").on("click", function() {
  349.                         return p(M, f.scrollIncrement), !1
  350.                     }).addClass(f.scrollDownButtonClass).appendTo(e)), f.clickTrackToScroll && a(j).on("click", function(b) {
  351.                         b.target === this && v(L, b.pageY > a(l).offset().top ? L.height() : -L.height())
  352.                     }), a(l).css({
  353.                         position: "absolute",
  354.                         "z-index": 1
  355.                     }).attr("href", "").addClass(f.verticalHandleClass).mousedown({
  356.                         pane: this
  357.                     }, r).click(function() {
  358.                         return !1
  359.                     }).appendTo(j), R(l, f.verticalHandleHTML), a(e).css(P).insertAfter(this), f.showOnHover && a(e).css("opacity", 0).on("mouseover.enscroll.vertical", function() {
  360.                         o.call(M, !1)
  361.                     }).on("mouseout.enscroll.vertical", function() {
  362.                         o.call(M)
  363.                     }), E = a(j).outerWidth(), f.addPaddingToPane && (K = "right" === f.verticalScrollerSide ? {
  364.                         "padding-right": h(this, "padding-right") + E + "px"
  365.                     } : {
  366.                         "padding-left": h(this, "padding-left") + E + "px"
  367.                     }, L.css(a.extend({
  368.                         width: L.width() - E + "px"
  369.                     }, K)));
  370.                     try {
  371.                         I = parseInt(L.css("outline-width"), 10), 0 !== I && !isNaN(I) || "none" !== L.css("outline-style") || L.css("outline", "none")
  372.                     } catch (S) {
  373.                         L.css("outline", "none")
  374.                     }
  375.                 }
  376.                 f.horizontalScrolling && (d = c.createElement("div"), g = c.createElement("div"), k = c.createElement("a"), a(g).css({
  377.                     position: "relative",
  378.                     "z-index": 1
  379.                 }).addClass("enscroll-track").addClass(f.horizontalTrackClass).appendTo(d), f.drawScrollButtons && (t = c.createElement("a"), C = c.createElement("a"), a(t).css("display", "block").attr("href", "").on("click", function() {
  380.                     return q(M, -f.scrollIncrement), !1
  381.                 }).addClass(f.scrollLeftButtonClass).insertBefore(g), a(C).css("display", "block").attr("href", "").on("click", function() {
  382.                     return q(M, f.scrollIncrement), !1
  383.                 }).addClass(f.scrollRightButtonClass).appendTo(d)), f.clickTrackToScroll && a(g).on("click", function(b) {
  384.                     b.target === this && u(L, b.pageX > a(k).offset().left ? L.width() : -L.width())
  385.                 }), a(k).css({
  386.                     position: "absolute",
  387.                     "z-index": 1
  388.                 }).attr("href", "").addClass(f.horizontalHandleClass).click(function() {
  389.                     return !1
  390.                 }).mousedown({
  391.                     pane: this
  392.                 }, s).appendTo(g), R(k, f.horizontalHandleHTML), a(d).css(P).insertAfter(this), f.showOnHover && a(d).css("opacity", 0).on("mouseover.enscroll.horizontal", function() {
  393.                     o.call(M, !1)
  394.                 }).on("mouseout.enscroll.horizontal", function() {
  395.                     o.call(M)
  396.                 }), D = a(g).outerHeight(), f.addPaddingToPane && L.css({
  397.                     height: L.height() - D + "px",
  398.                     "padding-bottom": parseInt(L.css("padding-bottom"), 10) + D + "px"
  399.                 }), f.verticalScrolling && (J = document.createElement("div"), a(J).css({
  400.                     width: "1px",
  401.                     height: "1px",
  402.                     visibility: "hidden",
  403.                     padding: 0,
  404.                     margin: "-1px"
  405.                 }).appendTo(this))), f.verticalScrolling && f.horizontalScrolling && f.drawCorner && (F = c.createElement("div"), a(F).addClass(f.cornerClass).css(P).insertAfter(this)), H = L.attr("tabindex"), H || (L.attr("tabindex", 0), O = !1);
  406.                 try {
  407.                     G = L.css("outline"), (!G || G.length < 1) && L.css("outline", "none")
  408.                 } catch (S) {
  409.                     L.css("outline", "none")
  410.                 }
  411.                 L.on({
  412.                     "scroll.enscroll.pane": function(a) {
  413.                         x.call(this, a)
  414.                     },
  415.                     "keydown.enscroll.pane": y,
  416.                     "mousedown.enscroll.pane": z
  417.                 }).css("overflow", "hidden").data("enscroll", {
  418.                     settings: f,
  419.                     horizontalTrackWrapper: d,
  420.                     verticalTrackWrapper: e,
  421.                     corner: F,
  422.                     _prybar: J,
  423.                     _mouseScrollHandler: Q,
  424.                     _hadTabIndex: O,
  425.                     _style: N,
  426.                     _scrollingX: !1,
  427.                     _scrollingY: !1,
  428.                     _startX: 0,
  429.                     _startY: 0,
  430.                     _endX: 0,
  431.                     _endY: 0,
  432.                     _duration: parseInt(f.easingDuration / 16.66666, 10),
  433.                     _scrollHeightNoPadding: i(this.nodeName)
  434.                 }), a(b).on("resize.enscroll.window", function() {
  435.                     B.reposition.call(L)
  436.                 }), f.showOnHover && L.on("mouseenter.enscroll.pane", function() {
  437.                     o.call(this)
  438.                 }), this.addEventListener ? ("onwheel" in this || "WheelEvent" in b && navigator.userAgent.toLowerCase().indexOf("msie") >= 0 ? this.addEventListener("wheel", Q, !1) : "onmousewheel" in this && this.addEventListener("mousewheel", Q, !1), this.addEventListener("touchstart", A, !1)) : this.attachEvent && this.attachEvent("onmousewheel", Q), f.pollChanges && B.startPolling.call(L), B.resize.call(L), B.reposition.call(L)
  439.             }
  440.         }))
  441.     }
  442. }(jQuery, window, document);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement