Jump to content
GreenSock

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

Sahil last won the day on November 25 2018

Sahil had the most liked content!

Sahil

Moderators
  • Content Count

    999
  • Joined

  • Last visited

  • Days Won

    71

Posts posted by Sahil

  1. Your ".box" element is covered by rest of the content, so mouse never moves over it. Try setting event on ".home" or some other element that won't be covered content, ".home" is container so it should work fine.

     

    Load TweenMax(or any other library that your code depends on) before your code. The TweenMax version you are using is really old, if you want to use GSAP 2 then use version 2.1.3 or use GSAP 3.

     

    https://cdnjs.com/libraries/gsap/3.1.1

    • Like 4
    • Thanks 1
  2. You can use cookies and trigger the mousemove event by creating jQuery's event.

     

    https://jsfiddle.net/ds6t5zec/1/

     

    Instead of triggering event you can just set the cursors position on load so it won't animate from (0, 0).  A better way would to just animate cursor in on first event, like scale it up where mouse is. That way you won't have to worry about cookies and it also takes care of how cursor animates when user visits for the first time. I had to use quickSetter method to avoid overwriting transform as it will interrupt scaling animation.

     

    https://jsfiddle.net/gpnta9oL/13/

     

     

    • Like 2
  3. I had to deal with this "issue" as well, I didn't go through entire code but for some reason ScrollMagic tries to update tween twice, then detects it as overwrite and tries to call onOverwrite method which has been removed from gsap 3. Certainly not related to GSAP and those are just warnings, you can ignore them without any issue. There are other compatibility issues, for example ScrollMagic tries to use 'Tween' object when you try to update scene duration on the fly, this gives error. You can set Tween equal to gsap directly in ScrollMagic files.

    • Like 1
  4. See the Pen ExaXjmr?editors=0010 by Sahil89 (@Sahil89) on CodePen

     

    You no longer need colorProps plugin, gsap will detect color strings and animate them. From release notes

     

    Quote

    The core engine will find colors inside complex strings and animate them properly (no plugins necessary). And of course it'll find all the numbers inside complex strings and animate those as well.  

     

    There is also new utility method called splitColor that you may find useful.

    • Like 4
  5. Hi,

     

    Just came across this odd behavior which didn't happen in gsap 2. If you click on buttons as follows, T1, T2, T1, T2 then you will notice that element's opacity just stays 0.1 and it also skips any calls at the start of timeline. The initial value does get recorded if I am resetting it somewhere in play head of timeline, uncomment line 38.

     

    Only workaround that seem to work is setting everything in onStart, a bit inconvenient but is that intended change? Release notes don't suggest using onStart to set values for repeating tweens.

    See the Pen PowYrEM?editors=0011 by Sahil89 (@Sahil89) on CodePen

    • Thanks 1
  6. You need to user horizontal scrolling for this, so you can trigger animations just as you do while vertical scrolling. Check out all other examples on that site, it has demo for almost everything.

     

    http://scrollmagic.io/examples/basic/going_horizontal.html

     

    If you don't want to use horizontal scrolling then you can use intersection observer API to trigger animations,

     

    https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

    • Like 5
  7. 4 hours ago, denken said:

    3) And finally, after a while the browser begins to slow down due to the number of paths.... 

     

    What you are trying to do is more suitable for canvas. It seems you are creating really long paths, which gets overwhelming for browser.

     

    It can be achieved using 2 canvas stacked on top of each other as layers. Draw your lines on bottom layer with lineCap set to round. And draw your circles on top layer. This way you won't be drawing too many paths unnecessarily.

    • Like 4
  8. You are using HTTP links on HTTPS site so they are getting blocked. Change your cdnjs urls to https.

     

    Quote

    Mixed Content: The page at 'https://www.m1xchange.com/' was loaded over HTTPS, but requested an insecure script 'http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'. This request has been blocked; the content must be served over HTTPS.

     

    Also note that you are using 'latest' link that actually points to really old version of GSAP. Latest version is 2.0.2.

     

    https://cdnjs.com/libraries/gsap

    • Like 5
  9. When you define a from tween, GSAP will set your element to that position and animate back to original position. So for example if your element is at 0 and you create a from tween with value of 100, GSAP will set your element to 100 and animate back to 0. If while creating the tween if element was at 50, then GSAP will animate from 100 to 50. If it was already at 100, then nothing will happen because start and end positions are same.

     

    I removed each because it was unnecessary. You can still use each and it will work.

     

    Also, with GSAP you don't need anything like jQuery's stop. GSAP overwrites any tweens for same property of the element by default. You can change the overwrite behavior if you ever need, check the docs. https://greensock.com/docs/TweenLite

     

    You can visit the learning page and youtube channel to get familiar with GSAP API,

     

    https://greensock.com/learning

     

    https://www.youtube.com/user/GreenSockLearning

    • Like 5
×