In this tutorial, we are going to create a loop grid with videos that play on hover (on desktop) and on scroll (on tablet and mobile).
See the demo in action here:
Features:
- Ideal for portfolios
- Videos play on hover on desktop
- Videos play on scroll, when in view, on mobile
- (optional) There is an image on top of the video to start with, which can represent the first frame (has in my demo) or could be any image at all (such as a video feature image)
- We are using the Elementor Loop Grid element here, so items can be made clickable to link to the Single Post page, or anywhere else (such as TikTok or YouTube)
- The videos are self hosted (required for smooth results), you will need to compress them well and self host efficiently. See my tutorial about self hosting video files with BunnyCDN. If your videos are small enough, they can be directly in your media library too.
We are going to use the free version of ACF to create the CPT and the custom fields, however you could also use any Custom Fields plugin, such as JetEngine, Metabox, Pods, Toolset, etc.
Let's get started!
First, get Custom Post Type setup and ready
This is a premium tutorial. Purchase access to unlock the full tutorial and access the template files.
23 Responses
Very nice design but i found the video only plays in the first time of hover?
if user hover another video and go back to the 1st video again the video won't play. Any idea what i am wrong in the settings please
Hey Delan!
I would need to see your page to understand what's going on here.
Cheers!
Bonjour, les templates que je téléverse sur mon site sont vides et n'affichent aucun contenu... Je n'arrive pas à installer votre tutoriel!
Hey Sebastien!
Do you have the containers enabled under WP Admin > Elementor > Features > Flexbox Containers?
oh yes! that's ok! thanks!
I would like the title not to appear on hover but to be permanently below the video? can you help me?
Have a look at the custom CSS that's under the Loop Template, on the first container > Advanced > Custom CSS field.
You should be able to edit it easily to show the title by default.
Hey Max, is there any chance to make this but using the Pro Gallery instead a loop?
Greetings Trevor!
Sorry it's not possible, the Pro Gallery doesn't accept videos, and 'hacking' this would not be worth it, in particular when we have the Loop Grid available.
Cheers!
Oh yeah, you are right! It was just to keep it simple and have chance to control grid from one place, but maybe in a future 🙂 Thanks bro!
Did you want to open images in a lightbox?
Hi Maxime! This is awesome. I have one question. My first video seems to not play on first hover, but plays fine on the second one. Do you have any idea why that happens? Cheers, Christian
Hey Christian!
I'm not certain... is sound enabled?
Could you share your URL?
Cheers!
Sound was enabled, but I muted them and still the same thing. I think it has to be the weight of the videos. I'll ask my customer if they can cut and compress them more.
Here's an URL: https://cw.digithings.io/arbeid/filmproduksjon/pris-produktfilmer/
Christian
Hey Christian!
It works just fine for me on first hover, with Chrome and Safari.
It's true that before the video actually starts playing, we have to wait a little bit. Yes compressing the videos further would help! Ideally under 1mb.
Cheers!
Thanks for checking!
Christian
Hi, I cant install the template, it says the file is invalid.
Greetings!
Did you go through these helper tutorials on importing or copy pasting?
https://element.how/elementor-cross-site-copy-paste/
https://element.how/importing-elementor-templates-to-your-pages/
Did you try everything there, and nothing worked?
Cheers!
Maxime
Hi, yes. I just tried again following the tutorial and have the same error.
Greetings,
Are you clicking the Folder icon while you are in the editor, and then the Upload arrow in the upper right corner?
Hi, yes. I am doing exactly that.
Hi again, I downloaded the file again and it worked this time. Thank you.
Awesome, glad it's working for you now!