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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -