Created
January 3, 2017 15:32
-
-
Save gkobilansky/798fa05c8c4c578017ce70f4ef61e6e6 to your computer and use it in GitHub Desktop.
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
/* Animations | |
* ------------------------------------------------------- */ | |
var ssAnimations = function() { | |
if (!$("html").hasClass('no-cssanimations')) { | |
$('.animate-this').waypoint({ | |
handler: function(direction) { | |
var defAnimationEfx = cfg.defAnimation; | |
if ( direction === 'down' && !$(this.element).hasClass('animated')) { | |
$(this.element).addClass('item-animate'); | |
setTimeout(function() { | |
$('body .animate-this.item-animate').each(function(ctr) { | |
var el = $(this), | |
animationEfx = el.data('animate') || null; | |
if (!animationEfx) { | |
animationEfx = defAnimationEfx; | |
} | |
setTimeout( function () { | |
el.addClass(animationEfx + ' animated'); | |
el.removeClass('item-animate'); | |
}, ctr * 50); | |
}); | |
}, 100); | |
} | |
// trigger once only | |
this.destroy(); | |
}, | |
offset: '95%' | |
}); | |
} | |
}; | |
/* Intro Animation | |
* ------------------------------------------------------- */ | |
var ssIntroAnimation = function() { | |
$WIN.on('load', function() { | |
if (!$("html").hasClass('no-cssanimations')) { | |
setTimeout(function(){ | |
$('.animate-intro').each(function(ctr) { | |
var el = $(this), | |
animationEfx = el.data('animate') || null; | |
if (!animationEfx) { | |
animationEfx = cfg.defAnimation; | |
} | |
setTimeout( function () { | |
el.addClass(animationEfx + ' animated'); | |
}, ctr * 300); | |
}); | |
}, 100); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment