欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
  CSS3animation-play-state属性
 
  作用:animation-play-state属性规定动画正在运行还是暂停。
 
  语法:
 
  animation-play-state:paused|running;
 
  paused:规定动画已暂停。
 
  running:规定动画正在播放。
 
  说明:您可以在JavaScript中使用该属性,这样就能在播放过程中暂停动画。
 
  注:InternetExplorer9以及更早的版本不支持animation-play-state属性。
 
  CSS3animation-play-state属性的使用示例
 
  
 
  
 
  <!DOCTYPEhtml>
 
  <html>
 
  <head>
 
  <style>
 
  div
 
  {
 
  width:100px;
 
  height:100px;
 
  background:red;
 
  position:relative;
 
  animation:mymove5s;
 
  animation-play-state:running;
 
  /*SafariandChrome*/
 
  -webkit-animation:mymove5s;
 
  -webkit-animation-play-state:running;
 
  }
 
  div:hover{
 
  animation-play-state:paused;
 
  -webkit-animation-play-state:paused;
 
  }
 
  @keyframesmymove
 
  {
 
  from{left:0px;}
 
  to{left:200px;}
 
  }
 
  @-webkit-keyframesmymove/*SafariandChrome*/
 
  {
 
  from{left:0px;}
 
  to{left:200px;}
 
  }
 
  </style>
 
  </head>
 
  <body>
 
  <div></div>
 
  </body>
 
  </html>

1.gif





本文转载自中文网

 

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c56265.shtml