Hi! I’ve made a menu in ae https://lottiefiles.com/share/7s1v2rkn
and would like to make it open on hover and be clicked on click on my wordpress site with lottie plugin. Is it possible at all ?
Hi! I’ve made a menu in ae https://lottiefiles.com/share/7s1v2rkn
and would like to make it open on hover and be clicked on click on my wordpress site with lottie plugin. Is it possible at all ?
Hi, did you find an answer for this?
I think, something like this
Find exactly where your button is in the html document
(use Inspect Element in Chrome, Safari, or Firefox);
Define the button in the html as an element in JS. I have used Document Object Model to do this. Example:
var lottie = document.getElementById(‘lottie’);
var button1 = lottie.childNodes[0].childNodes[1].childNodes[2];
Create the function which will describe what happens when you click on the button.
And change the animation frame in this function. 50 - number of the frame.
button2.onclick = function() {
anim.goToAndPlay(50, true);
}
Also if you need, there is goToAndStop function. It sets the frame and stops.
Add a hover effect using JS
Also it needs to stop the animation when it reach a particular frame but I don’t know yet how to do this and I’m thinking about it