Created
January 9, 2020 06:53
-
-
Save webjp1/984fd30ca14adef0a9416054688b3a19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.viewportWatcherExampleTrigger').viewportWatcher(function() { | |
// Element is in the Viewport Do Something | |
$(this).find('.viewportWatcherExample').fadeIn('slow'); | |
}, function() { | |
// Element is out of the Viewport Do Other Thing | |
let display = $(this).css('display'); | |
if (display != "none") { | |
$(this).find('.viewportWatcherExample').fadeOut('fast'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment