<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<div id="abc" style="background-color:red; width:400px; height:300px;"></div>
<div id="def" style="background-color:black; width:400px; height:300px;"></div>
<script>
function Fade(type,delay,callback){
var it=delay || 10 ,time,a=0,b=100,that=this;
function set(i){
this.style.filter ="alpha(opacity=" + i + ")";
this.style.opacity= i/100;
}
function clear(){
clearInterval(time);
if(callback){
callback.call(this);
}
}
({
'in':function(){
set.call(that,0);
time=setInterval(function(){
a++;
if(a<=100){
set.call(that,a);
}else{
clear.call(that);
}
},delay)
},
'out':function(){
set.call(that,100);
time=setInterval(function(){
--b
if(b>=0){
set.call(that,b);
}else{
clear.call(that);
}
},delay)
}
}[type])();
arguments.callee.init=function(a){
set.call(this,a);
}
}
var d=document.getElementById('abc');
var e=document.getElementById('def');
Fade.call(d,'out',10,function(){
Fade.call(d,'in',15,function(){
Fade.call(d,'out',10,function(){
Fade.call(d,'in',15,function(){
Fade.call(e,'in',15,function(){
setTimeout(function(){
alert('end');
},500);
});
});
});
});
});
Fade.init.call(e,0);
</script>
</body>
</html>
分享到:
相关推荐
Arduino项目开发 Basics_Fade_Fade.pdf Arduino项目开发 Basics_Fade_Fade.pdf Arduino项目开发 Basics_Fade_Fade.pdf Arduino项目开发 Basics_Fade_Fade.pdf Arduino项目开发 Basics_Fade_Fade.pdf
行业教育软件-学习软件-fade in pro剧本软件 3.0.578.zip
Fade Out Bottom——是一款在网页底部产生淡入淡出效果的JavaScript插件,不管显示在网页底部的是文字或是图片,它都将其修饰为渐变的淡入淡出风格,拖动网页的滚动条之后,它仍会将显示在最底部的内容变为淡入淡出...
Mouseover Fade Effect
用matlab写一段代码FADE-听觉歧视实验的仿真框架 该软件可用于对简单的声学识别,检测和鉴别实验进行建模。 主要作者:2014-2020年MarcRenéSchädler电子邮件: 该软件包中提供的脚本可用于执行[1]和[2]中所述的...
易语言—打造电音FADE
主要介绍了使用jQuery写的fadeTo,需要的朋友可以参考下
专业剧本编辑软件,mac版,解压后直接安装,输入压缩包内注册码即可激活
algorithm to fade objects
android 屏幕保护程序--------Fade In 与 Fade Out 特效与运行线程
Fade2back
flex利用actonscript自定义fade效果,循环一下,就可以实现闪烁的效果
Electric Vehicle Article
#text-fade-effect 这是使用HTML,CSS和JS制作的。 在这里,我创建了一个文本淡入淡出效果,当屏幕滚动到其一半大小时,文本将从底部出现淡入淡出效果。
前端开源库-glsl-transition-fadeglsl transition fade,简单的fade glsl transition对象
input the sound file and it will perform the fade in, fade out and echo on that. it is a dsp project done on the matlab.
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
能够逐行显示输入文字的特效插件,用法举例: $(".ww1" ).lbyl({ content: "1111111"... type: 'fade', fadeSpeed: 500, finished: function() { } // Finished Callback });
在QPSK下的OFDM误码率仿真程序,其中包含comb m,delay m,fade m,giins m,girem m,ofdm_
npm i react-native-fade-in-out-slideshow 导入React Native import Slideshow from ' react-native-fade-in-out-slideshow ' 例子 const items = [ { image: ' ...