Jump to content
Search Community

IE Support for attr{x: val}

marcmorales.ca test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi, I'm fairly new to this SVG animation and getting by mostly by copying someones work and modifying it. (Still learning alot).

For that codepen link that I've provided - it works smoothly in almost all browsers except IE and IE Edge.

 

Its basically moving the pattern from SVG horizontally and repeating it. It seems like IE cannot recognize attr:{x} for some reason.

 

advance thanks!

See the Pen gLEGmJ by marcmorales345 (@marcmorales345) on CodePen

Link to comment
Share on other sites

@Dipscom

 

Sure thing, based on what I've done so far - you can see that the <pattern> attr changes in IE and Edge via dev tools but for some reason - it doesn't reflect to its graphic. All other known browsers doesnt seem to have this problem (haven't tried it in Safari).

 

SVG doc itself is being injected to its parent element via Ajax...so it's techincally inline. (Tried hardcoding SVG to HTML and still the same issue). - Just an added info if needed.

Link to comment
Share on other sites

You're going to see the attribute change even if it's not valid. What's important to understand about attributes is that they initialize a value on an element if they are valid.

<circle id="myCircle" r="5" />

console.log(myCircle.r.baseVal.value); // => 5

You can even animate it using that method. Funny thing with IE/Edge though, it doesn't work without the circle animation.

See the Pen zogjqj?editors=0010 by osublake (@osublake) on CodePen

 

If all you're trying to do is that loader animation, just use the ModifiersPlugin...

See the Pen QEdpLe by GreenSock (@GreenSock) on CodePen

  • Like 3
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...