also any idea how to run script after html load?
I have try add the whole code into webflow main settings custom code
footer section without the
async function
but still apart from the pin function doesnt work
and according to console there are no script related bug
update:
â
I have tried 9 different way at the footer section in the main settings
*1st no bug still apart from the pin function doesnât work
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/ScrollTrigger.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/TextPlugin.min.js"></script>
<script>
const myTextElement = document.getElementById("typing_text");
gsap.to(".typing_text", {
text: myTextElement.innerText,
scrollTrigger: {
trigger: "#info",
pin: ".typing",
start: "center center",
end: "center top",
scrub: true,
}
}
*2nd: no bug still apart from the pin function, doesnât work
<script>
const myTextElement = document.getElementById("typing_text");
gsap.to(".typing_text", {
text: myTextElement.innerText,
scrollTrigger: {
trigger: "#info",
pin: ".typing",
start: "center center",
end: "center top",
scrub: true,
}
}
);
</script>
*3rd: Uncaught TypeError: Cannot read properties of null (reading âinnerTextâ)
<script>
gsap.to(".typing_text", {
text: myTextElement.innerText,
scrollTrigger: {
trigger: "#info",
pin: ".typing",
start: "center center",
end: "center top",
scrub: true,
}
}
);
</script>
Also tried with defer and later async to include in with previous setup
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/gsap.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/ScrollTrigger.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/TextPlugin.min.js"></script>
*1st: Uncaught ReferenceError: gsap is not defined
*2nd: Uncaught ReferenceError: gsap is not defined
*3rd: Uncaught ReferenceError: gsap is not defined
Also tried reverse
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/gsap.min.js"defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/ScrollTrigger.min.js"defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/TextPlugin.min.js"defer></script>
same result: Uncaught ReferenceError: gsap is not defined
â