Jump to content
GreenSock

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

ScrollMagic GSAP SVG Mask Bug

Recommended Posts

I am using ScrollMagic with the GSAP Plugin.


I am trying to reveal a line based on an animated mask that should sync to the scroll.

This demo works on Desktop but not on iOS:

 

 

I am not sure if this is an ios, svg, scrollmagic or gsap bug.

 

Any help is appreciated!

See the Pen aVGwEw by paul-siteway (@paul-siteway) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Thanks for the demo.

I don't have an iOS11 device handy but I would suggest you reduce the demo even more.

Just try to set the height on that element without GSAP and see if it works like:

 

maskPath = $('#path-1');
maskPath.attr("height", "1280")

 

I know it some cases it is recommended not to animate things in <defs> tags as some browsers don't update changes, not sure of the particulars.

My hunch this is a bug on the browser side and not GSAP.

 

Someone else may have some more insight.

  • Like 1
Link to comment
Share on other sites

Yep, I think Carl is right about it being very risky to animate things in <defs>, especially for masking. I'd strongly recommend avoiding that. It's not a GSAP thing - it's just a browser rendering thing unfortunately. Wish I had better news for you. 

  • Like 1
Link to comment
Share on other sites

I've experienced the same issue you have right now. but it only happens when I create SVG in HTML document. (Like copy paste SVG from illustrator or svgomg, and  also coding SVG data by hand without concerning browser compatibility ) I know its kind of wired. but to solve my problem I used SnapSVG plugin to create and animate SVG element with GSAP. specially masking and clipping related animations. and it can handle browser compatibility pretty well. but like @Carl sed before try to avoid <defs> data animation as much as possible. this might not be the correct solution but I suggest you to give it a try and see. but for me, the SnapSVG plugin work well with every desktop and mobile browsers.

  • Like 1
Link to comment
Share on other sites

Hello @Carl, Hello @Jack, Hey @Yashi-2

 

 

Manual animation (click the button in the CodePen demo) works. It just does not work synced to the scroll. 

I will try a workaround the <defs> Animation. Will post an Update here. 

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.
×