Forum Discussion
NathanStoker-c1
Community Member
Math, this is what I got. It's probably not the most efficient way, but it worked for me. What are your thoughts? I couldn't ever get the web object working. So this is just a javascript trigger.
const script1 = document.createElement('script');
script1.src = "https://cdn.jsdelivr.net/npm/gsap@3/dist/TextPlugin.min.js";
script1.async = false;
script1.onload = function() {
function animateText() {
const myText = document.querySelector('[data-acc-text="textIt"]');
// Set the initial font size and color:
myText.style.fontSize = "64px";
myText.style.color = "#007bff";
// Animate the text:
gsap.to(myText, {
duration: 2,
text: "This is the new text",
ease: "none"
});
}
animateText();
};
document.body.appendChild(script1);
MathNotermans-9
4 months agoCommunity Member
If it works, donot try to fix it ;-)