Animate separator won’t work
-
I am trying re-create an animated separator (horizontal border) that starts at 0px and opens right as an user scrolls down page. I want it 8px height and about 120px wide. For the animation, I want it to work similar to the one shown here ref: Elementor Line, Image and Text Reveal On Scroll. I did hire a developer to do this for my Elementor website, but it only works on the home page and only 2x/page. I want to use it throughout my site. Any help would be greatly appreciated. Here is the Javascript he used:
<script>
document.addEventListener("DOMContentLoaded", function() {
window.addEventListener("load", function(e){
gsap.registerPlugin(ScrollTrigger);
gsap.fromTo('.selector-del-divisor-1 .elementor-divider-separator',
{ width: 0 },
{
width: "100%",
duration: 2, // Duración de la animación en segundos
scrollTrigger: {
trigger: '.selector-del-divisor-1 .elementor-divider-separator',
start: 'top 80%', // Comienza la animación cuando el top del divisor llega al 80% del viewport
toggleActions: 'play none none none' // Acciones de animación: play, pause, resume, reverse
}
});
});
gsap.fromTo('.selector-del-divisor-2 .elementor-divider-separator',
{ width: 0 },
{
width: "100%",
duration: 2, // Duración de la animación en segundos
scrollTrigger: {
trigger: '.selector-del-divisor-2 .elementor-divider-separator',
start: 'top 80%', // Comienza la animación cuando el top del divisor llega al 80% del viewport
toggleActions: 'play none none none' // Acciones de animación: play, pause, resume, reverse
}
});
});The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Animate separator won’t work’ is closed to new replies.