Jump to content
Search Community

Benny

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Benny

  1. Hi everyone,

    I'm new at all this, and just finally hopped onboard gsap with the ScrollTrigger plugin release. But now I've run into a basic installation issue and can't seem to find similar in the forums.

     

    This is the only code I've left uncommented for gsap:

    window.onload = function(){
    //timeline functions
    //HOME PAGE CONDITION
    if( ishome() ) {
    //Scroll */
    gsap.registerPlugin(ScrollTrigger);

     

    I get this error:
    image.thumb.png.eb450f2dfaf5503850b586532e234150.png

    At the registration call. And the code inside indicates that the body element is undefined:
    image.png.7308234249ab4c1763474133eccddea5.png


    So the problem isn't likely the source files or body tag. The environment is a wordpress install and the files are called with the following enqueue function. As a result of all this trail and error I've tried unminified versions, I've run the files locally instead of CDN, and included map files when calling minified files. I'm running out of ideas.
     

    function neon_enqueue()
    {
     
    wp_enqueue_style( 'neon-css', get_template_directory_uri() . '/dist/css/style.css', array(), '1.0.0', 'all' );
    //wp_enqueue_script( 'greensock', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.0/gsap.min.js', array(), '3.3', false );
    wp_enqueue_script( 'greensock', get_template_directory_uri() . '/dist/js/gsap.min.js', array(), '3.3', false );
    wp_enqueue_script( 'scrolltrigger', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.0/ScrollTrigger.js', array('greensock'), '3.3', false );
    wp_enqueue_script( 'theme-js', get_template_directory_uri() . '/dist/js/theme.js', array(), '1.0.0', false);
    wp_enqueue_script( 'footer-js', get_template_directory_uri() . '/dist/js/footer.js', array('gs-animation-library'), '1.0.0', true);
    }

     

    I know this is a local environmental issue and not reproducible, but it has to be something really simple I'm not understanding right.

     

    Anyone have some insight here?

    Thanks!

     

×
×
  • Create New...