Your display: none should be executed immediately, not after the transition animation, so it is hidden directly. If you need to do this 1. You can delay the execution of the dislpay:none operation. setTimeout(function(){//execute},200); 2. Use jQuery’s animate for the above operation, and then set dislpay: none in the callback of animate; 3. Directly envy jQuery’s slidedown
Your display: none should be executed immediately, not after the transition animation, so it is hidden directly.
If you need to do this
1. You can delay the execution of the dislpay:none operation. setTimeout(function(){//execute},200);
2. Use jQuery’s animate for the above operation, and then set dislpay: none in the callback of animate;
3. Directly envy jQuery’s slidedown
Animation can be written in
jQuery
ofanimate()
. After the animation is completed, execute the callback functiondisplay:none
that makes itListen to the
in the callbacktransitionend
event and perform thedisplay:none
operation