如何使用 MooTools 创建延迟?
我更喜欢 jquery,对 MooTools 不太熟悉。我已经在 MooTools 网站上阅读了有关创建延迟的内容,但恐怕我不够精明,无法将其添加到我的脚本中。
页面加载后,我想在这种情况发生之前添加 300 毫秒的延迟:
window.addEvent('domready', function(){
var data = {};
var myShow = new Slideshow.delay(1000)('show', null, {controller: true, height: 467, hu: 'half-moon-bay-wedding/', thumbnails: true, width: 730, loop:false});
});
我想这对于熟悉 MooTools 的人来说可能是简单的事情? 感谢您的帮助和想法!
I'm more of a jquery guy, and not too familiar with MooTools. I've read up on creating a delay on the MooTools site, but I'm afraid I'm not savvy enough to add it to my script.
After the page loads, I want to add a 300ms delay before this happens:
window.addEvent('domready', function(){
var data = {};
var myShow = new Slideshow.delay(1000)('show', null, {controller: true, height: 467, hu: 'half-moon-bay-wedding/', thumbnails: true, width: 730, loop:false});
});
I'm thinking this is probably simple stuff to someone who knows MooTools well?
Thank you for your help and thoughts!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
例如,您可以尝试:
这样,您的 SlideShow 调用将被包装在一个匿名函数中,一旦 300 毫秒的延迟过去,该函数就会被调用。
当然可以在文档中找到更多信息: http://mootools.net/文档/核心/类型/函数#函数:延迟
You could for instance try:
This way, your SlideShow call will be wrapped in an anonymous function, that will be called as soon as the delay of 300 ms has passed.
More info can of course be found in the docs: http://mootools.net/docs/core/Types/Function#Function:delay