<div id="demo" class="yui3-module">
<a href="" title="fade out element" class="yui3-remove">Click to animate</a>
</div>
<script src="js/yui-min.js"></script>
<script type="text/javascript">
YUI().use('anim', function(Y) {
var anim = new Y.Anim({
node: '#demo',
to: { width: 500, height: 300 }
});
var anim2 = new Y.Anim({
node: '#demo',
to: { width: 100, height: 100 }
});
var onClick = function(e) {
e.preventDefault();
anim.run();
anim2.run(); //how to run anim2 ???
};
Y.one('#demo .yui3-remove').on('click', onClick);
});
如何在 anim.run 发生后运行下一个 anim2,即作为一个链。有什么简单的方法可以做到这一点。??