Skip to content

Instantly share code, notes, and snippets.

@origamid
Last active December 27, 2015 16:19
Show Gist options
  • Save origamid/7354175 to your computer and use it in GitHub Desktop.
Save origamid/7354175 to your computer and use it in GitHub Desktop.
JS: Visibility
Visibility.onVisible(function(){
var header = $('header'),
home = $('.home'),
homeH1 = $('.home h1'),
homeBlockquote = $('.home blockquote'),
homeButton = $('.home .origamid-button'),
mainH2 = $('main h2'),
child1 = $('main ul li.origami:nth-child(1)'),
child2 = $('main ul li.origami:nth-child(2)'),
child3 = $('main ul li.origami:nth-child(3)');
setTimeout(function () {
header.addClass('animated fadeInDown'); }, 500);
setTimeout(function () {
homeH1.addClass('animated fadeInDown'); }, 1500);
setTimeout(function () {
homeBlockquote.addClass('animated fadeInDown'); }, 2000);
setTimeout(function () {
homeButton.addClass('animated fadeInDown'); }, 2500);
setTimeout(function () {
mainH2.addClass('animated fadeInDown'); }, 3000);
setTimeout(function () {
child1.addClass('animated fadeInLeft'); }, 3500);
setTimeout(function () {
child2.addClass('animated fadeInDown'); }, 3500);
setTimeout(function () {
child3.addClass('animated fadeInRight'); }, 3500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment