Jump to content
Search Community

className:"+="

Mcsnidely 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

Hello,

 

I'm using the following code to animate a div coming in and to add a class to a second div.

 

Working perfectly on the mac and ios but on windows there are some issues.

 

ie8 animation working but the classname is not being added (haven't tried newer versions).

 

firefox nothing is working.

 

here is my code:

 

$(document).ready(function() {

var tl = new TimelineMax();

tl.append( TweenLite.to(awardOne, .125, {css:{className:"+=awardOneOn"}}) );

tl.append( TweenLite.to(awardOneContent, .125, {css:{autoAlpha:1}}) );

tl.append( TweenLite.to(awardOneContent, .5, {css:{height:159,top:480}}) );

tl.pause();

 

awardOne.onclick = function() {

tl.play();

};

 

closeIcon.onclick = function() {

tl.reverse();

};

});

 

Thank you

-Dennis

Link to comment
Share on other sites

Listen, I know you may be working late at night, but if you really expect someone to help you now, you're dreamin.

 

 

:)

 

Hey D!

 

Sorry to hear this isn't working for you.

I did a quick and simple test of +=className and it worked fine on

Mac: chrome, firefox

PC: IE8, Firefox, chrome

 

view it here: http://jsfiddle.net/geekambassador/gc57U/

 

In cases like this, and especially when IE8 is in the mix, its especially helpful to see what css is on the element prior to the tween and what is in the new "className" class.

 

If you can, please try to provide a simplified file that isolates the issue, just enough css/js/html for us to see things breaking.

 

You can upload a zip (click the "more reply options") button, fork that fiddle I linked to, or email me. Any way is fine. Would love to help you through this.

 

I'm sure we can get it worked out for you.

 

Best,

Carl

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