Jump to content
Search Community

imagesLoaded does not work with gsap

GeorgeErshov test
Moderator Tag

Recommended Posts

https://codepen.io/GeorgeDesign2020/project/editor/AJnPPg#

 

Friends. I faced a big problem in my project. I created an animation for the appearance of photos from mouse movements. But my animation conflicts and doesn't work with gsap.min.js :( I found out this way: I turned off each script and watched whether my picture animation worked or not and I found out that if I remove the gsap.min.js script, the animation works, but my smooth scroll disappears.
You can see more details in my project. 
I concealed the script the gsap.min.js script for you to see the photo animation. Turn it on the script to understand what I'm talking about. Once all the scripts are active, the smooth scrolling works, but the imagesLoaded script stops performing its function....
I understand that you can't answer all the questions, but I really ask you to tell me what's wrong?

 

See the Pen AJnPPg by GeorgeDesign2020 (@GeorgeDesign2020) on CodePen

Link to comment
Share on other sites

  1. You definitely shouldn't be loading that super old https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js file. 
  2. You had invalid HTML. You were missing a closing </div>
  3. You were referencing TweenMax.isTweening() (old) instead of gsap.isTweening(). There are a bunch of other examples like that of using the old/outdated v2 stuff instead of the new GSAP 3 syntax. 
  4. You never declared a lastMousePos variable. 
  5. Your script.js file is referencing a bunch of elements that don't exist, like ".h1", etc. (lots of console warnings)

There are just too many issues to dig into. I wish we had the resources to provide free general consulting services for projects like this, but unfortunately we must keep these forums focused on GSAP-specific questions. If you still need help, I'd strongly recommend breaking things down into a minimal demo and building it up from there. Or you may need to hire someone to spend the time necessary to troubleshoot all the problematic code. We're happy to answer any GSAP-specific questions, though. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...