How to display an element in the middle of CSS3 animation -


in example, want display element in step of animation. however, not possible, because if set display:none in main css rule, animation not override it.

#test {     -webkit-animation: test 2s;     display:none; // here problem, animation not override it. }  @-webkit-keyframes test {     0%{margin:5px}     20%{display:block}     70%{margin:40px} } 

note simplified example, , in practice, need use display:none hide element before becomes visible animation. thus, other tricks opacity not satisfy need.

i'm not sure you're trying do, if want hide element , show when animation starts, make use of visibility property this:

#test {   -webkit-animation: test 2s;   visibility:hidden;  }  @-webkit-keyframes test {    0%{margin:5px}   20%{visibility:visible}   70%{margin:40px} } 

fiddle example


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -