アニメーションの名前を指定します。
animation-name:
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="ja" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="imagetoolbar" content="no" /> <title>animation-name</title> <link rel="stylesheet" type="text/css" href="/content/lib/global.css" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="./js/jquery.vendorprefix.js"></script> <script type="text/javascript"> $(function(){ $("#rgrp input[type=radio]").click(function(){ var val=this.value; var prefix=$.fn.VendorPrefix(); var rint = Math.round(0xffffff * Math.random()); var rgb='rgb(' + (rint >> 16) + ',' + (rint >> 8 & 255) + ',' + (rint & 255) + ')'; $("#sample").find("p").remove(); var $obj=$("<p>Sample</p>").appendTo("#sample"); $obj.css("background-color",rgb); $obj.css(prefix+"animation-name",val); $obj.css("animation-name",val); }); }); </script> <style type="text/css"> #sample { width:300px; height:300px; background:#eee; } #sample p { margin:0; padding:0; width:100px; height:100px; background:#ccc; position:relative; line-height:100px; text-align:center; font-weight:bold; animation:myani 3s ease 1s 2 alternate; /* CSS3 */ -webkit-animation:myani 3s ease 1s 2 alternate; /* Chrome, Safari */ -moz-animation:myani 3s ease 1s 2 alternate; /* Firefox */ -ms-animation:myani 3s ease 1s 2 alternate; /* IE */ -o-animation:myani 3s ease 1s 2 alternate; /* Opera */ } /* myani */ @keyframes myani { from {left:0px;} to {left:200px;} } @-webkit-keyframes myani { from {left:0px;} to {left:200px;} } @-moz-keyframes myani { from {left:0px;} to {left:200px;} } @-ms-keyframes myani { from {left:0px;} to {left:200px;} } @-o-keyframes myani { from {left:0px;} to {left:200px;} } /* myani2 */ @keyframes myani2 { from {left:0px;} to {top:200px;} } @-webkit-keyframes myani2 { from {left:0px;} to {top:200px;} } @-moz-keyframes myani2 { from {left:0px;} to {top:200px;} } @-ms-keyframes myani2 { from {left:0px;} to {top:200px;} } @-o-keyframes myani2 { from {left:0px;} to {top:200px;} } </style> <link rel="stylesheet" type="text/css" href="/common/css/example.css"></head> <body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP & JavaScript Room</a> :: 設置サンプル</h1> <h3 class='h'>実行結果</h3> <div id="wrap"> <h1>設置サンプル</h1> <h2>animation-name</h2> <p>アニメーションの名前を指定します。</p> <!-- CODE --> <p id="rgrp"> animation-name: <label for="r1"><input type="radio" name="r" id="r1" value="myani" checked="checked">myani</label> <label for="r2"><input type="radio" name="r" id="r2" value="myani2">myani2</label> </p> <div id="sample"> <p>Sample</p> </div> <!-- CODE / --> </div> </body> </html>