Hello,
I made the changes by installing the latest version of gsap
// The proper way to enqueue GSAP script
// wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
function theme_gsap_script() {
wp_enqueue_script( 'gsap-js', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.2.6/gsap.min.js', array(), false, true );
wp_enqueue_script( 'gsap-js1', get_stylesheet_directory_uri() . '/js/custom-gsap-scripts.js', array(), false, true );
}
add_action( 'wp_enqueue_scripts', 'theme_gsap_script' );
and this is my js code that I call in custum-gsap-script.js
// wait until DOM is ready
document.addEventListener("DOMContentLoaded", function (event) {
console.log("DOM loaded");
// wait until images, links, fonts, stylesheets, and js is loaded
window.addEventListener("load", function (e) {
// custom GSAP code goes here
const tl = gsap.timeline();
tl.fromTo(".logo", {
opacity: "0"
}, {
opacity: "1",
x: 60,
duration: 0.5,
})
.fromTo(".slider-typography", {
height: "0%"
}, {
height: "100%",
opacity: "1",
ease: "easeInOut",
duration: 1,
delay: 0.5,
})
.fromTo(".slider-title-big4", {
opacity: "0"
}, {
opacity: "1",
y: -20,
duration: 0.5,
})
.fromTo("h1", {
opacity: "0"
}, {
opacity: "1",
y: -20,
duration: 0.5,
})
}, false);
});
I no longer have the previous error message.
But when loading the page, I get well the expected effects however, I think there is a conflict with another plugin because the effects are jerky and load badly ...
Here is the link of the page: https://preprod.girod.co.uk/integration-et-formation/
Can you help me with that? By