在 mootools 链中设置延迟
我一直在尝试设置一个 mootools 链以将其应用到网站中。所以,我已经做到了,但是,仍然...我需要在序列开始时设置延迟,我的意思是,在一切开始之前等待 5 秒,我尝试设置 .delay(5000) 但只是不起作用,请帮忙。谢谢,这是完整的代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Probando chain de mootools</title>
<script src="mootools.js" type="text/javascript"></script>
<script>
var ClaseChainEfecto = new Class({
//implemento chain
Implements: Chain,
initialize: function(){
this.efecto1 = new Fx.Tween('elem1', {
property: 'opacity',
duration: 1000,
onComplete: function(){
this.callChain();
}.bind(this)
});
this.efecto2 = new Fx.Tween('elem2', {
property: 'opacity',
duration: 1000
});
},
efectos: function(){
this.chain(
function(){ this.efecto1.start(1,0); },
function(){ this.efecto2.start(0,1); }
);
this.callChain();
}
});
window.addEvent("domready", function(){
miClaseChainEfecto = new ClaseChainEfecto();
miClaseChainEfecto.efectos();
});
</script>
<style type="text/css">
.miestilo1{
float: left;
width: 80px;
background-color: 333399;
color: #fff;
padding: 15px;
font-size: 14pt;
margin: 15px;
float:left;
position:absolute;
}
.miestilo2{
float: left;
width: 80px;
background-color: 333399;
color: #fff;
padding: 15px;
font-size: 14pt;
margin: 15px;
visibility:hidden;
opacity:0;
float:left;
position:absolute;
}
</style>
</head>
<body>
<div id="elem1" class="miestilo1">
HOLA!! estoy probando chain. Pongo esta capa con más texto para que se vea!!
</div>
<div id="elem2" class="miestilo2">
Esto es un segundo elemento. Que también tendrá su efecto!
</div>
</body>
</html>
i've been trying to set a mootools chain to apply it then in a site. So, i've done it but, still... i need to set a delay on the beggining of sequence, i mean like, wait for 5 seconds before everything starts, i've tried to set .delay(5000) but just doesn't work out, pleeaaase help. thanks, here's the full code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Probando chain de mootools</title>
<script src="mootools.js" type="text/javascript"></script>
<script>
var ClaseChainEfecto = new Class({
//implemento chain
Implements: Chain,
initialize: function(){
this.efecto1 = new Fx.Tween('elem1', {
property: 'opacity',
duration: 1000,
onComplete: function(){
this.callChain();
}.bind(this)
});
this.efecto2 = new Fx.Tween('elem2', {
property: 'opacity',
duration: 1000
});
},
efectos: function(){
this.chain(
function(){ this.efecto1.start(1,0); },
function(){ this.efecto2.start(0,1); }
);
this.callChain();
}
});
window.addEvent("domready", function(){
miClaseChainEfecto = new ClaseChainEfecto();
miClaseChainEfecto.efectos();
});
</script>
<style type="text/css">
.miestilo1{
float: left;
width: 80px;
background-color: 333399;
color: #fff;
padding: 15px;
font-size: 14pt;
margin: 15px;
float:left;
position:absolute;
}
.miestilo2{
float: left;
width: 80px;
background-color: 333399;
color: #fff;
padding: 15px;
font-size: 14pt;
margin: 15px;
visibility:hidden;
opacity:0;
float:left;
position:absolute;
}
</style>
</head>
<body>
<div id="elem1" class="miestilo1">
HOLA!! estoy probando chain. Pongo esta capa con más texto para que se vea!!
</div>
<div id="elem2" class="miestilo2">
Esto es un segundo elemento. Que también tendrá su efecto!
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论