Created
January 8, 2020 19:47
-
-
Save webjp1/a8da6f1d3ae3a495411127ade3341353 to your computer and use it in GitHub Desktop.
Revisions
-
webjp1 created this gist
Jan 8, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ $('#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(); }); });