Skip to content

Instantly share code, notes, and snippets.

@Barrytron1983
Created August 12, 2014 14:36
Show Gist options
  • Save Barrytron1983/42e265bc19f5364a101e to your computer and use it in GitHub Desktop.
Save Barrytron1983/42e265bc19f5364a101e to your computer and use it in GitHub Desktop.
Fade in a load of elements sequentially on view (inview.js & wordpress)
//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