書式
new YUIobj.Anim({
easing : 動き方
});
YUIobj : YUIオブジェクト
説明
アニメーションの動きを指定するにはAnim()メソッドのコンフィグオプションのeasingに動きを示す関数を指定します。この関数は以下のものが定義されています。
| backBoth |
| backIn |
| backOut |
| bounceBoth |
| bounceIn |
| bounceOut |
| easeBoth |
| easeBothStrong |
| easeIn |
| easeInStrong |
| easeNone |
| easeOut |
| easeOutStrong |
| elasticBoth |
| elasticIn |
| elasticOut |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="css/yui.css" type="text/css" media="all">
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="../../../lib/yui/yui.js"></script>
<script type="text/javascript"><!--
function startAnime(){
YUI().use('anim', function(Y){
var anim = new Y.Anim({
node: '#box',
from : { xy: [20, 50]},
to : { xy: [400, 200] },
easing : Y.Easing.easeOut
});
anim.run();
});
}
// --></script>
</head>
<body class="yui-skin-sam">
<h1>アニメーションの動きを指定</h1>
<form>
<input type="button" value="開始" onClick="startAnime()">
</form>
<div id="box">
ここが移動します。
</div>
</body>
</html>