Jump to content
Search Community

Combining the demo Typewriter effect with ScrollTrigger

Detrol test
Moderator Tag

Go to solution Solved by Detrol,

Recommended Posts

  • Solution

I got it sorted after some sleep. Wasn't so difficult, just a tired brain.

const myTextElement = document.getElementsByClassName("jag-decoy");
const timePerCharacter = 0.02;

gsap.to(".jag", {
    scrollTrigger: {
        trigger: ".jag",
        toggleActions: "play",
        start: "top 90%",
        end: "bottom 50%+=100px",
    },
    text: {
        value: myTextElement[0].innerHTML
    },
    duration: myTextElement[0].innerText.length * timePerCharacter,
    delay: 0.5,
    ease: "none",
    delimiter: " "
})

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...