Tiggles ツ of Speak Creative
11/28/2018 - 5:37 PM

animate within viewport

start animation when element comes into view

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>


<script>
$(window).scroll(function() {
	$('#animatedElement').each(function(){
	var imagePos = $(this).offset().top;

	var topOfWindow = $(window).scrollTop();
		if (imagePos < topOfWindow+400) {
			$(this).addClass("slideUp");
		}
	});
});
	</script>