当单击链接“单击此处开始”时,我需要为 div 的“介绍”设置动画,使其高度和宽度为零,这很有效。另一个 div 'theTest' 需要在同一事件中淡入。不幸的是,它不起作用。我是 YUI 的新手,我用它作为来源。
jsfiddle:http: //jsfiddle.net/pV8eT/1/
代码:
(function() {
var introductionAttributes = {
width: { to: 0 },
height: { to: 0 }
};
var theTestAttributes = {
visible: { to: true },
width: { to: 500 },
height: { to: 500 }
};
var introductionAnim = new YAHOO.util.Anim('introduction', introductionAttributes);
var theTestAnim = new YAHOO.util.Anim('theTest', theTestAttributes);
YAHOO.util.Event.on('startTest', 'click', function() {
introductionAnim.animate(); //this works
theTestAnim.animate(); //this doesnt work :(
});
})();
如何修改代码以淡入 div "theTest" ?