Jump to content
Search Community

IE 8 and IE7 javascript error

seagoat 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

I'm getting the following error when trying to run Tweenlite in IE7 and IE8. I have no troubles with the animations I'm running in grade A browsers as well as IE9.

 

I'm using tweenlite and the cssplugin. I imagine it has something to do with the properties I'm using for animation.

 

 

 

 

SCRIPT87: Invalid argument.
[url="0"]TweenLite.min.js, line 44 character 35[/url]

 

 

Here is a sample of how I'm using tweenlite:

 

TweenLite.to( $(tabber), 1, {css:{left: 0}, ease:Expo.easeOut});

TweenLite.to($self,useSpeed,{css:{backgroundPosition:coords},ease:Cubic.easeOut});

Link to comment
Share on other sites

I think it's possible your issue is the result of a trailing comma in an object/array. IE8 and below are horrible jerks about this and add an undefined element after the comma, which causes all sorts of strife e.g.

TweenLite.to(target, 1, { css:{ left:0, top:0, } }); // BAD

TweenLite.to(target, 1, { css:{ left:0, top:0 } }); // GOOD

 

I'd double check your TweenLite calls to make sure there's none of these (possibly coords has one?). It's annoying to have to keep tabs on something like this when every other browser is smart enough, but that's what we have to deal with when working with IE.

Link to comment
Share on other sites

And backgroundPosition is very inconsistent in IE. It actually doesn't properly support backgroundPosition - instead it splits them into backgroundPositionX and backgroundPositionY (which no other browser supports). However, I dropped in some code that should smooth out the differences in the browsers. Just use backgroundPosition which is technically the standard. I also added some code that will handle going from a % to px (or visa-versa). I wonder if that was your problem.

 

Please try the attached files and let me know if they resolve the error for you.

updated_2012-12-13.zip

Link to comment
Share on other sites

Doesn't seem like those files made a difference. Still seeing an error in IE7 and IE8 at Line 44 and Character 35 "Invalid argument".

 

And backgroundPosition is very inconsistent in IE. It actually doesn't properly support backgroundPosition - instead it splits them into backgroundPositionX and backgroundPositionY (which no other browser supports). However, I dropped in some code that should smooth out the differences in the browsers. Just use backgroundPosition which is technically the standard. I also added some code that will handle going from a % to px (or visa-versa). I wonder if that was your problem.

 

Please try the attached files and let me know if they resolve the error for you.

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