In this tutorial I'm going to show you how we can add nice entrance animations to items that have been loaded through AJAX.
By default, Elementor doesn't have any AJAX loading. Several of the addons have this option however.
In particular, we are going to focus on the very popular JetSmartFilters filter addon from Crocoblock.
See a live demo of what we will be creating here:
Notice the animation of the filtered list items after a filter is changed. By default, there is no option to have this kind of animation. By following this tutorial however, you will learn how to easily add it!
We will have two different effects, both of which can be customized.
The first one is this Fade In Up animation.
The other one is this Zoom In animation.
Features:
- Compatible with all AJAX loaded content
- Works for JetEngine Listing Grid, WooCommerce product grid, Elementor Posts, Archives, etc.
- Choice of two animations
- The animation is customizable easily, through editing the CSS
Important to note that this tutorial does NOT include any filtering solution. It's solely about adding animations to grid lists that are filtered through AJAX, with plugins such as JetSmartFilters.
Let's get started!
First, let's locate the right selector for your project
This is a premium tutorial. Purchase access to unlock the full tutorial.
7 Responses
Hi! it works great, but what if my grid is lower on the page? and i want an entrance animation triggered when in viewport? (like a regular elementor entrance animation)
Would this be possible? Thanks in advance!
Hey Ruben!
First of all, my apologies for answering just now.
Regarding your request, I think I understand what you are asking, and yes it is possible. However it's not really the intention of the current tutorial, and the technique required is completely different...
Essentially, you want that when the viewport reaches a listing grid of one sort of another, the elements animate in sequentially You don't want this to happen after filtering them, or clicking a "load more" button. Is that right?
Hi Maxime,
Im trying to use this code on elementor posts and loop items: .elementor-post, .e-loop-item.
I changed this at the beginning of the code ijn the style css. But isn't there a possibility to also get this to work for the sequential animations in the tags? I tried to do this: let animSelectors = ".elementor-post, .e-loop-item"; but this broke the sequential animation.
I read this code is only for one instance, but isnt there just a really easy way to also get the sequential animation to work with multiple appended css classes?
Thank you!
Toine
I forgot to mention that im using the code as a elementor custom code on the entire website. If that gives some context why im wanting to add multiple classes in the code.
Greetings Toine,
Could you let me see your page? That'd give me a better idea what you are looking for here...
Thanks!
Hey Toine,
Try this JS. Adjust animSelectors as you need.
if (!document.querySelector('.elementor-editor-active')) {
let animSelectors = [".jet-listing-grid__item"];
animSelectors.forEach(animSelector => {
let animEntries = 18;
let headElem = document.getElementsByTagName('head')[0];
let animStylesElem = document.createElement('style');
for (let i = 1; i <= animEntries; i++) {
animStylesElem.innerHTML += animSelector + `:nth-child(${i}){
animation-delay:${i / 10 - 0.1}s;
}
`
}
headElem.appendChild(animStylesElem);
});
};