From e1910cde3ee516d349673f11d237d3bb70251e98 Mon Sep 17 00:00:00 2001 From: DanielApt Date: Mon, 16 Nov 2015 22:25:11 +0000 Subject: [PATCH] use pageX/YOffset instead of scrollX/Y As pointed out by @pliasetski these properties are not supported in IE11 and below This fixes #409 --- src/js/plugin/handler/click-rail.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/plugin/handler/click-rail.js b/src/js/plugin/handler/click-rail.js index c08ba05..18692e3 100644 --- a/src/js/plugin/handler/click-rail.js +++ b/src/js/plugin/handler/click-rail.js @@ -19,7 +19,7 @@ function bindClickRailHandler(element, i) { } i.event.bind(i.scrollbarYRail, 'click', function (e) { var halfOfScrollbarLength = h.toInt(i.scrollbarYHeight / 2); - var positionTop = i.railYRatio * (e.pageY - window.scrollY - pageOffset(i.scrollbarYRail).top - halfOfScrollbarLength); + var positionTop = i.railYRatio * (e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top - halfOfScrollbarLength); var maxPositionTop = i.railYRatio * (i.railYHeight - i.scrollbarYHeight); var positionRatio = positionTop / maxPositionTop; @@ -40,7 +40,7 @@ function bindClickRailHandler(element, i) { } i.event.bind(i.scrollbarXRail, 'click', function (e) { var halfOfScrollbarLength = h.toInt(i.scrollbarXWidth / 2); - var positionLeft = i.railXRatio * (e.pageX - window.scrollX - pageOffset(i.scrollbarXRail).left - halfOfScrollbarLength); + var positionLeft = i.railXRatio * (e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left - halfOfScrollbarLength); var maxPositionLeft = i.railXRatio * (i.railXWidth - i.scrollbarXWidth); var positionRatio = positionLeft / maxPositionLeft;