Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Animation au chargement d'articles en ajax (wordpress)
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
You can’t perform that action at this time.