Created
August 12, 2014 14:36
-
-
Save Barrytron1983/42e265bc19f5364a101e to your computer and use it in GitHub Desktop.
Fade in a load of elements sequentially on view (inview.js & wordpress)
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
//in Header: | |
<script src="<?php bloginfo('template_directory');?>/js/jquery.inview.min.js"></script> | |
//(also need JQuery 1.4 or above) | |
//where fds is a containing div and li items are the ones to be faded in....: | |
<script> | |
$(function() { | |
$('#fds').bind('inview', function(event, visible) { | |
$('#fds li').each(function(i){ | |
$(this).delay((i++) * 500).fadeTo(1000, 1); }); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment