diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 79d985af5..b31384e81 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -11,7 +11,8 @@ ### Version 2.2.10 - February 21, 2017 **Bugs** -**Visibility** - Fixed bug where using visibility with `context` setting on a scrollable context (with overflow) would cause callbacks to fire incorrectly +- **Visibility** - Fixed bug where using visibility with `context` setting on a scrollable context (with overflow) would cause callbacks to fire incorrectly +- **Visibility** - Fixed bug where `top passed` and `bottom passed` would appear as incorrect values if using settings from `get element calculations` when element is off screen. ### Version 2.2.9 - February 21, 2017 diff --git a/src/definitions/behaviors/visibility.js b/src/definitions/behaviors/visibility.js index 75129d5bd..804fee928 100644 --- a/src/definitions/behaviors/visibility.js +++ b/src/definitions/behaviors/visibility.js @@ -915,10 +915,10 @@ $.fn.visibility = function(parameters) { } // visibility - element.topVisible = (screen.bottom >= element.top); element.topPassed = (screen.top >= element.top); - element.bottomVisible = (screen.bottom >= element.bottom); element.bottomPassed = (screen.top >= element.bottom); + element.topVisible = (screen.bottom >= element.top) && !element.bottomPassed; + element.bottomVisible = (screen.bottom >= element.bottom) && !element.topPassed; element.pixelsPassed = 0; element.percentagePassed = 0;