Last active
December 12, 2015 07:09
-
-
Save curtisj44/4734483 to your computer and use it in GitHub Desktop.
Show hidden items as they appear in viewport
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
var windowBottom = $(window).scrollTop() + $(window).height(); | |
$(window).scroll(function () { | |
$('.hideme').each(function (i) { | |
var $this = $(this), | |
objectBottom = $(this).position().top + $(this).outerHeight(); | |
if (windowBottom > objectBottom) { | |
$(this).animate({'opacity': '1'}, 500); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment