CSS3 transition transition-delay property
Syntax:
transition-delay :
transition-delay is used to specify the time when an animation starts to execute, that is, how long it takes after the element attribute value is changed. Start executing the transition effect, its value:
Sometimes we not only change the properties of one css effect, but want to change the transition effects of two or more css properties, then we only need to string several transition statements together with commas ("," ) separated, and then each can have its own different duration and time rate transformation method. But something worth noting: The values of transition-delay and transition-duration are both times, so to distinguish their positions in the sequence, browsers generally decide according to the order. The first value that can be parsed as time is The second transition-duration is transition-delay. For example:
a { -moz-transition: background 0.5s ease-in,color 0.3s ease-out; -webkit-transition: background 0.5s ease-in,color 0.3s ease-out; -o-transition: background 0.5s ease-in,color 0.3s ease-out; transition: background 0.5s ease-in,color 0.3s ease-out; }
If you want to perform all transition effect attributes on the element, then we can also use the all attribute value to operate. At this time, they share the same duration and rate transformation method. , such as:
a { -moz-transition: all 0.5s ease-in; -webkit-transition: all 0.5s ease-in; -o-transition: all 0.5s ease-in; transition: all 0.5s ease-in; }
Based on the above, we can give transition a shorthand: transition:
Corresponding example code:
p { -webkit-transition: all .5s ease-in-out 1s; -o-transition: all .5s ease-in-out 1s; -moz-transition: all .5s ease-in-out 1s; transition: all .5s ease-in-out 1s;}
Code example:
Example one:
php中文网
In the above code, hovering the mouse over the div requires a delay of two seconds before executing the animation effect.
Example 2:
php中文网
In the above code, when the mouse is hovering over the div, it will delay 2 seconds and 6 seconds respectively before starting to point to the width and height. Animated transition effects.