一个JS实现的文字淡入淡出不断闪动的文字特效代码。
代码如下:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
ie4 = ((navigator.appVersion.indexOf("MSIE")>0) && (parseInt(navigator.appVersion)
>= 4));
var count = 0, count2 = 0, add1 = 3, add2 = 10, timerID;
function show() {
if (ie4) {
count += add1;
count2 += add2;
delay = 30;
if(count2 > 100) count2 = 100;
if(count > 100) {
count = 100;
add1 = -10;
add2 = -3;
delay = 350;
}
if(count < 0) count = 0;
if(count2 < 0) {
count2 = 0;
add1 = 3;
add2 = 10;
delay = 200;
}
fader.style.filter = "Alpha(Opacity="+count2+",FinishOpacity="+count+",style=2)";
timerID = setTimeout("show()", delay);
}
}
window.onload = show;
// End -->
</script>
<div id="fader" style="width:730; Filter:Alpha(Opacity=0,FinishOpacity=0,style=2)">
<h1>
<font family="Arial, Helvetica" color="maroon" size="+3">
懒人建站-解放出你的部分写代码时间来思考更高层次的设计 51xuediannao.com
</h1>
</div>