Jump to content
Search Community

creativo

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by creativo

  1. I am not sure what I am missing.

     

    i think i have added all the required elements but the SplitText does not work. i don't know where to go from here.

     

    in my  functions.php - I have added the following:

     

    function theme_gsap_script() {
    wp_enqueue_script( 'gsap-js', '/wp-content/plugins/gsap/gsap.min.js', array(), false, true );
    wp_enqueue_script( 'SplitText', '/wp-content/plugins/gsap/SplitText.min.js', array(), false, true );
    wp_enqueue_script( 'gsap-script', get_stylesheet_directory_uri() . '/js/gsap-scripts.js', array(), false, true );
    }
    add_action( 'wp_enqueue_scripts', 'theme_gsap_script' );

     

    in my gsap-scripts.js- I have added the following:
     

    const myText = new SplitType('#my-text')

            gsap.to('.char', {
                y: 0,
                stagger: 0.05,
                delay: 0.2,
                duration: .1
            })

     

     

    on my page I added:

    <h1 id="my-text">St. Elizabeths West Campus</h1>

     

     

×
×
  • Create New...