Created
January 8, 2020 19:47
-
-
Save webjp1/a8da6f1d3ae3a495411127ade3341353 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
$('#checkIfIsOnViewport').click(function(){ | |
$('.testToSeeIfIsOnViewport').OnViewport(function(){ | |
// Element is on viewport | |
// alert("Element Is On Window Viewport"); | |
console.log($(this)); | |
$(this).fadeOut(); | |
},function(){ | |
// Element is not on Viewport | |
// alert("Element is not on Window Viewport"); | |
console.log($(this)); | |
$(this).fadeIn(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment