控制MooTools 1.2中淡入淡出功能的持续时间
我在 MooTools 1.2 中使用了一个非常简单的淡入淡出函数(由于在同一页面上调用另一个函数,我“必须”使用 MooTools 1.2)。我基本上是在页面上淡入标题。一切都很好,但我似乎找不到有关如何简单地控制持续时间的文档。我发现的所有内容似乎都引用了其他函数,我想使其尽可能简单。这是我得到的 javascript:
window.addEvents({
load: function(){
var singleImage = $('myimage2');
singleImage.set('styles', {
'opacity': 0,
'visibility': 'visible'
});
singleImage.fade('in');
}
});
如您所见,它采用 id="myimage2" 的图像(我最初用 CSS 隐藏了该图像),并在文档准备好时淡入。它消失得很快,我希望它能逐渐消失。有什么想法吗?谢谢。
I'm using a very simple fade function with MooTools 1.2 (I 'have' to use MooTools 1.2 due to a complication over another function being called on the same page). I'm basically fading a title in on my page. Everything works great but I can't seem to find documentation on how to control the duration simply. Everything I find seems to refer to other functions and I'd like to keep this as simple as possible. Here's the javascript I've got:
window.addEvents({
load: function(){
var singleImage = $('myimage2');
singleImage.set('styles', {
'opacity': 0,
'visibility': 'visible'
});
singleImage.fade('in');
}
});
So as you see, it takes an image with id="myimage2" (which I have initially hidden with CSS) and fades in when the document is ready. It fades in quickly and I'd like it to fade in more gradually. Any ideas? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用上一个问题中的示例 - http://jsfiddle.net/RNeS5/208/
Using the example from your previous question - http://jsfiddle.net/RNeS5/208/