Created
January 6, 2017 13:56
-
-
Save olirabt/afd730c5da6404d1280e822ca6bf281f to your computer and use it in GitHub Desktop.
Animation au chargement d'articles en ajax (wordpress)
This file contains hidden or 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
var AnimationArticles = function(articlesBruts, articlesContainersTab) { | |
this.articlesBruts = articlesBruts; | |
this.articlesContainersTab = articlesContainersTab; | |
this.newlyLoadedTab = []; | |
this.articlesTraites; | |
this.newlyLoadedContainer; | |
this.init(); | |
} | |
AnimationArticles.prototype.init = function(){ | |
$('.newlyLoadedActu').removeClass('newlyLoadedActu'); | |
this.parsing(); | |
}; | |
AnimationArticles.prototype.getNewlyLoadedContainer = function(){ | |
return this.newlyLoadedContainer; | |
}; | |
AnimationArticles.prototype.parsing = function(){ | |
this.newlyLoadedContainer = document.createElement('div'); | |
this.newlyLoadedContainer.innerHTML = this.articlesBruts; | |
this.newlyLoadedContainer.className += 'newlyLoadedActu'; | |
this.newlyLoadedTab = $('.newlyLoadedActu').find('.media'); | |
}; | |
AnimationArticles.prototype.animate = function(){ | |
$('.newlyLoadedActu a.media').each(function(index, elem) { | |
setTimeout(function() { | |
TweenMax.to($(elem), 0.8, { opacity: 1, ease: Sine.easeOut, }); }, index * 220); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment