diff --git a/src/css/main.scss b/src/css/main.scss index c67e555..b19474f 100644 --- a/src/css/main.scss +++ b/src/css/main.scss @@ -53,13 +53,13 @@ $ps-bar-hover: #999; @mixin in-scrolling { &.ps-in-scrolling { pointer-events: none; - >.ps-scrollbar-x-rail { + &.ps-x>.ps-scrollbar-x-rail{ @include scrollbar-rail-hover; >.ps-scrollbar-x { @include scrollbar-hover; } } - >.ps-scrollbar-y-rail { + &.ps-y>.ps-scrollbar-y-rail { @include scrollbar-rail-hover; >.ps-scrollbar-y { @include scrollbar-hover; diff --git a/src/js/plugin/ps.js b/src/js/plugin/ps.js index 1b10f5f..925ab6a 100644 --- a/src/js/plugin/ps.js +++ b/src/js/plugin/ps.js @@ -218,6 +218,7 @@ module.exports = function (element, settingOrCommand) { }; var mouseUpHandler = function (e) { + cls.remove(element, 'ps-x'); cls.remove(element, 'ps-in-scrolling'); $(ownerDocument).unbind(eventClass('mousemove'), mouseMoveHandler); }; @@ -226,6 +227,7 @@ module.exports = function (element, settingOrCommand) { currentPageX = e.pageX; currentLeft = h.toInt(d.css(scrollbarX, 'left')); cls.add(element, 'ps-in-scrolling'); + cls.add(element, 'ps-x'); $(ownerDocument).bind(eventClass('mousemove'), mouseMoveHandler); evt.once(ownerDocument, 'mouseup', mouseUpHandler); @@ -250,6 +252,7 @@ module.exports = function (element, settingOrCommand) { }; var mouseUpHandler = function (e) { + cls.remove(element, 'ps-y'); cls.remove(element, 'ps-in-scrolling'); $(ownerDocument).unbind(eventClass('mousemove'), mouseMoveHandler); }; @@ -258,6 +261,7 @@ module.exports = function (element, settingOrCommand) { currentPageY = e.pageY; currentTop = h.toInt(d.css(scrollbarY, 'top')); cls.add(element, 'ps-in-scrolling'); + cls.add(element, 'ps-y'); $(ownerDocument).bind(eventClass('mousemove'), mouseMoveHandler); evt.once(ownerDocument, 'mouseup', mouseUpHandler);