Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I temporarily turn off all CSS3 transitions/animations whilst an element is built?

I have created a rather complex Menu for a website. The menu lives from a huge amount of animation which is based on CSS3. However, when i navigate to a different page, the menu should build up initially - and without all the animations, but done JS-wise and not serverside.

Now i am wondering how i could completely disable all the transitions/animations temporarily, until the menu is built.

I thought about creating a subclass that overrides the animations but it does not seem to work, as it is always the animation/transition defined in the base class that is being used?

like image 502
SquareCat Avatar asked Nov 29 '11 13:11

SquareCat


1 Answers

I’d suggest applying your animations/transitions via a class that’s added by JavaScript after the menu is built.

There is the animation-play-state property which can pause animations, but that only appeared (prefixed) in Safari 5 and Chrome 4 (as opposed to Safari 4 and Chrome 2 for the other animation properties), and I’m not sure if it’d work for your purposes.

like image 82
Paul D. Waite Avatar answered Oct 12 '22 23:10

Paul D. Waite