YUI Anim 示例出错
我在尝试模拟 YUI Anim 示例时遇到错误:
<script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script>
<script>
YUI().use('anim-base', function(Y){
var anim = new Y.Anim({
node: '.notice',
to: {height: 300},
easing: Y.Easing.backIn
});
onClick = function(e){
e.preventDefault();
anim.run();
};
Y.get('.notice').on('click', onClick);
});
</script>
错误是:
Y.Easing 是未定义的缓动: Y.Easing.backIn\r\n
我的印象是 YUI 加载器会检索所需的文件。
I'm getting an error when trying to emulate an YUI Anim sample:
<script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script>
<script>
YUI().use('anim-base', function(Y){
var anim = new Y.Anim({
node: '.notice',
to: {height: 300},
easing: Y.Easing.backIn
});
onClick = function(e){
e.preventDefault();
anim.run();
};
Y.get('.notice').on('click', onClick);
});
</script>
The error is:
Y.Easing is undefined easing:
Y.Easing.backIn\r\n
I was under the impression that YUI loader would retrieve the needed files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我从 YUI Library 论坛得到了答案,我将引用它:
I got my answer from the YUI Library forum which I will quote:
在这种情况下,添加动画缓动似乎是正确的答案 - use() 只是您需要的子模块。不过,Stefan 是正确的:您需要列出在实现中直接依赖的所有子模块。
Adding anim-easing, in this case, seems like the right answer -- use() just the submodules you need. Stefan is correct, though: You need to list all the submodules that you're depending on directly in your implementation.