Hi!!
I want my gifs to start playing after they are hovered. How can I achieve this interaction??
Hope you can help. Thank you!!!
Here is my public share link: LINK
(how to access public share link)
Hi!!
I want my gifs to start playing after they are hovered. How can I achieve this interaction??
Hope you can help. Thank you!!!
Here is my public share link: LINK
(how to access public share link)
Hii
You public link is not working…
I would recommend to use Lottie instead of video, so you can set a Lottie animation to play when hover.
Convert the gif to video
GIF to MP4 (Online & Free) — Convertio
Convert the video to Lottie
Video To Lottie Converter - Isotropic
Set a hover animation on the Lottie, to play when hovering.
Let me know if it worked and if worked, set this comment as solution to help others.
Thanks and good lucky
Hi @AASM21
You may use Background Video element + script placed on page settings Before tag :
<script>
const videoContainers = document.querySelectorAll('.animation-play-hover');
function playVideo(video) {
video.play();
}
function stopVideo(video) {
video.pause();
video.currentTime = 0;
}
videoContainers.forEach((videoContainer) => {
const video = videoContainer.querySelector('video');
videoContainer.addEventListener('mouseover', () => {
playVideo(video);
});
videoContainer.addEventListener('mouseout', () => {
stopVideo(video);
});
});
</script>
Also make sure that on your videos disabled “Autoplay video”:
Live Demo: GIF animation to play on Hover
Read-Only Project: Webflow - BroPlayGround
Thank you so much bro design!! I uploaded my gif to YouTube but it shows my name and the play button, how can I get rid of this to show the video as a gif immediately after hovering? I know they are basic questions but I’m just migrating to webflow. Thanks for your time!
Thank you soooo much!!!
Hi Bro design sorry to bother you with this again I don’t know where to place the script, if you read this I hope you can help me!!! Thank youuu
Forgot to put my link Webflow - Copy of Serial Muse Design
Yes!! I did that but it doesn’t work
https://preview.webflow.com/preview/serialmusewebsite-d949536f6228f8bf9dcd4?utm_medium=preview_link&utm_source=designer&utm_content=serialmusewebsite-d949536f6228f8bf9dcd4&preview=d8deba52adaa8e8ea92ac865c2fbedfe&workflow=preview
Oh you page structure is looks no good🌝 For example read this about Heading Elements. Also your videos card structure should be redo too (check my reference structure).
Also be you may just provide me in DM your WF account credentials and I fix video cards issue.