Jump to content
Search Community

Class name based css tweens, loadsa trouble.

halfbyte 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 sorry, this first stab at a description might be a bit unspecific, but I might need some help to find out where to start looking.

 

I'm currently building a rather complex animation (using TimelineMax), with many of the tweens based on class names. Usually this works fine but now I have one specific case of a forward animation (removing a class name with className: "-=class") working, but if I play the animation backwards (or seek before the tween), the className doesn't get readded (and the tweens are not done, too).

 

I have currently 4 tweens at the specific position in the Timeline, all with the same length, two adding a class and two removing a class (all on different selectors). This may sound a lot, but I have various other pieces in the animation that use even more tweens without problems. Of these four, the two that add a class work, the other two don't.

 

 

I am not able to properly reproduce the bug in a clean room situation, which makes me think that this might be some weird edge case. (And by that I mean that as soon as I try to remove tweens around this or even only separate the tweens in the timeline so that they don't overlap, the bug disappears)

 

 

I am currently using 1.641. Which brings me to my second point: I tried to upgrade my project to 1.8.1 today and had to roll back immediately because there were a ton of regressions. Most notably that after doing class based tweens, the inline styles were not removed (this may be intentional for performance reasons?) but in a lot of cases, the inline styles did not morph to the values set in the stylesheet. Is this known?

 

I assume that without knowing more about my project, it's virtually impossible to make any guesses on what's going wrong, so my question goes more along the lines of: How do I best debug this? I can't really share the whole project publicly right now, so how to best proceed with this?

 

Thanks a lot in advance, until today, using the GSAP has been a ton of fun :)

 

Jan

 

Link to comment
Share on other sites

Ah, the usual effect. I may have just fixed my animation by choosing different values for positions and lengths of the tweens.

 

Some explanation: I try to express my animation phases in pixels (the animation is "played" by swiping) instead of seconds and use a certain "speed" factor to convert the values. As it seems I chose some bad numbers here, resulting in floats with weird fractions. 

 

Could it be the case that the tween triggers have indeed some edge cases where calculations result in missing the trigger points? (Do I make sense here?)

 

I will try to investigate (but not tonight for sure) if my issues with the 1.8.1 release are also caused by bad fractions, will report later.

 

Thanks,

 

Jan

Link to comment
Share on other sites

Hmmmm...sorry to hear about the trouble. We're not aware of any bugs in 1.8.1 (that doesn't mean none exist though). Typically each incremental version FIXES bugs and/or adds features. I'm very curious to see an example of the bugs you're encountering, but I know you said you're limited in terms of what you can share. I don't mind signing an NDA if that's necessary. My best guess is that you've got some sort of overwriting happening where overlapping tweens are battling for the same property of the same object, so one is killing the other (that happens internally on purpose). Have you tried setting overwrite:"none" on the tweens just for kicks? 

 

As far as regressions in 1.8.1, could you provide more details about that? From what we've seen, it's working like a champ and is definitely recommended over any previous version. Any clues you can give (especially example files) would be greatly appreciated. We're committed to making sure ANY and ALL bugs are squashed. 

Link to comment
Share on other sites

Oh, one more thing that might be causing the problems: I wonder if you had code that used the old "offsetOrLabel" parameter in TimelineLite or TimelineMax which we recently changed/enhanced: http://www.greensock.com/v12-api-change/. Are you aware of that? We are VERY cautious about API changes that could alter the way things behave, but this particular change seemed important to do at this point. Updating your code really isn't too bad (most people are unaffected because they didn't use the offsetOrLabel parameters anyway). It's basically adding += or -= prefixes and wrapping the values in quotes. Let me know if you need any more specifics. But when you said a bunch of stuff broke when you used 1.8.1, that'd make sense if you had used offsetOrLabel and didn't know what to look for. Again, just a guess.

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