From 064477c47d9f48a41b086e09811bed8e0b0a7dea Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Tue, 7 Mar 2017 14:06:41 -0500 Subject: [PATCH] Fix math on scroll context --- src/definitions/behaviors/visibility.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/definitions/behaviors/visibility.js b/src/definitions/behaviors/visibility.js index 804fee928..12f4dfe62 100644 --- a/src/definitions/behaviors/visibility.js +++ b/src/definitions/behaviors/visibility.js @@ -887,10 +887,10 @@ $.fn.visibility = function(parameters) { element.height = $module.outerHeight(); // compensate for scroll in context if(module.is.verticallyScrollableContext()) { - element.offset.top += $context.scrollTop(); + element.offset.top += $context.scrollTop() - $context.offset().top; } if(module.is.horizontallyScrollableContext()) { - element.offset.left += $context.scrollLeft(); + element.offset.left += $context.scrollLeft - $context.offset().left; } // store module.cache.element = element;