Jump to content
Search Community

zenific

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by zenific

  1. I have the same issue. I'm new to GreenSock and following the "Get Started with GSAP Quickly" video, trying to see if I can get it to work in a WordPress 4.3 site I'm making locally in Ubuntu Linux. I added TweenMax code to the bottom of functions.php: function theme_gsap_script() { wp_enqueue_script( 'gsap-js', 'http://cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenMax.min.js', array(), false, true ); } add_action( 'wp_enqueue_scripts', 'theme_gsap_script' ); and main.js where the other js files get added in functions.php: wp_enqueue_script( 'tesseract-main', get_template_directory_uri() . '/js/main.js', array(), '1.0.0', true ); They both show up in the page source. I typed the HTML into a visual editor, using the same code shown in the video except for the name of the svg, leaving out the body tags. The svg, bug.svg, displays in the browser page at http://localhost/zentess/ <div class="gradient"></div> <div class="demo"> <img class="logo" src="http://localhost/zentess/wp-content/themes/Tesseract/images/bug.svg" alt="bug" /> </div> <script src="wp-content/themes/Tesseract/js/main.js"></script> Here's the code from main.js: TweenMax.to(".bug", 2, {left:600}); When I refresh the page nothing happens with the svg, in the Chrome v44 console it says 'Uncaught ReferenceError: TweenMax is not defined', below that it says (anonymous function) @main.js:1 On the next line the same error message is repeated, the only difference is that it says this below: (anonymous function) @main.js?ver=1.0.0:1 Typing in windows.TweenMax returns this: function r(t, e, s) I'm using the Meta Slider plugin for a slideshow, if that matters at all. Any idea what I might have missed or coded incorrectly? I'm new to all this. I love the animation I've seen on other websites and was hoping to do the same, but if it doesn't work I'll just have to skip it. I haven't found much on using GSAP with WordPress. Thanks for any help.
×
×
  • Create New...