HTML and CSS Reference
In-Depth Information
</style>
</head>
<body>
<div id="anim1"> Watch me move and change size! </div>
</body>
</html>
O NLINE http://htmlref.com/ch6/animationdirection.html
Compatibility
CSS3 Proposed
Chrome 3+, Safari 3.1+
Notes
• WebKit supports this property as -webkit-animation-direction .
• If the animation-direction is alternate , the timing function will also alternate
if appropriate.
• Firefox 3.7 pre-releases show support for CSS transitions which are very related to
CSS animation. It is quite likely that a form of this property using the -moz prefix
may be supported in a Firefox browser by the time you read this.
animation-duration
This property is used to define the time it takes one iteration of an animation to play.
Syntax
animation-duration: time [, time ]*
where time is a valid time value like 5s or 3500ms. The initial value of time is 0, meaning no
animation plays.
Example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> CSS Animations - animation-duration </title>
<style type="text/css">
@-webkit-keyframes move {
from {left: 0;top: 0;}
50% {left: 300px;top: 0;}
to {left: 300px;top: 300px;}
}
@-webkit-keyframes resize {
from {width: 100px;height: 300px;}
50% {width: 100px;height: 100px;}
to {width: 300px;height: 100px;}
}
#anim1 {-webkit-animation-name:move, resize;
-webkit-animation-duration: 4s, 10s;
position:absolute;
background-color: purple;}
Search WWH ::




Custom Search