Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

ADawn

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

1 Newbie

About ADawn

  • Rank
    Newbie
  1. I thought I would give some closure to this thread, though it is older. The Go To plugin was loading the wrong version of TweenMax and it was interfering with the function of the scrollTo plugin despite having the correct version of TweenMax loaded later.
  2. ADawn

    TweenMax is not defined

    There are no errors in the browser and the TweenMax script tag shows up in the DOM after page load with no problems. The main.js file is also loading in the footer as intended. Using the get_template_directory_uri() will get me the directory for the parent theme, whereas my main.js file resides in a child theme, with the path /wp-content/themes/venedor-child/js/main.js. Based on the script links that are present in the DOM after the page has loaded and the fact that there are no 404 errors associated with either script, it appears that I am referencing my JS correctly. No other errors show up in the console either. I am also checking with the Wordpress and theme support communities and will post the fix if I find it . Thank you for the response Jonathan.
  3. ADawn

    TweenMax is not defined

    Thank you for your response Carl. I'm sorry, I can't link to this specific site, and all my test pages work as expected. Codepens work as expected. Clean WordPress installations work as expected. The problem seems to be unique to this setup. I know it was a long shot asking for help without being able to link to the project. I had hoped there was someone who had run into this already and could help me with a new direction for troubleshooting.
  4. I am using Wordpress and am loading TweenMax via the functions.php file like this: add_action('wp_enqueue_scripts', 'child_scripts'); function child_scripts() { wp_enqueue_script('gsap', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js'); wp_enqueue_script('main-js', get_stylesheet_directory_uri() . 'main.js', array('gsap'), false, true); } Both <script> tags are showing up fine and in the correct order in the page source code after load and there are no loading errors for either resource. I am trying to use TweenMax with the typical TweenMax.to() statement in the above referenced main.js file, but I am getting the "TweenMax is not defined" error that usually indicates that I forgot to include the library. It happens even after all plugins are deactivated and when using the 2016 theme. I have used TweenMax many times before and have never run into this issue.
  5. This was the problem. A plugin called Go Pricing is interfering with the ScrollTo plugin somehow. I can't believe I failed to perform such a basic troubleshooting step. The page source shows that the jQuery is still loading before any of the other scripts. Is the interference something to do with a non-jQuery later function definition that is overriding ScrollTo? It is happening on all browsers and on every page that has ScrollTo on it. This is the page: http://decographic.staging.wpengine.com/solutions/ This happens when I am logged out and logged in. After running the log you suggested, I got "cannot read property 'version' of undefined" while the offending plugin was active and the version number when it was not. I am also putting all my custom scripts at the bottom of the page, and have tried putting the libraries in the footer as well, with no change. I have tried the changes you suggested to that line of code, too, with no results. In light of this, the fact that my files are enqueued correctly, and the fact that the proper script tag consistently shows up in the "view page source" output, what could be causing ScrollTo to appear to not exist when in fact it does? Thank you so much for your answers. I'm grateful for everyone's help .
  6. The ScrollTo plugin has been working perfectly with exactly the same code for the last 4 or 5 months as I developed this website. However, shortly after deployment (on the same hosting provider), I am getting the error "Uncaught TypeError: Failed to execute 'scrollTo' on 'Window': 2 arguments required, but only 0 present." As evidenced by the included screenshot of the page source, the plugin is successfully loading on the page, and the one line of JS that is calling the plugin on this page looks like this. solutionsTl.to($(window), .8, { scrollTo: {y: scroll}, ease: Circ.easeOut}, "-=.5"); I have tried adding an x value and trying a different target, as well as rearranging my header in various ways to include scripts in a different order, but nothing is working. All of the threads I can find both here and on Stack Overflow are resolved with the answer that they need to include the ScrollTo plugin. However, I would like to stress that the ScrollTo plugin has been successfully loaded, and this code was working perfectly for a period of 4 to 5 months after finishing this section of the JavaScript. I am at a loss. Any help would be much appreciated.
×