24.htm

来自「介绍了javascript的常用的函数」· HTM 代码 · 共 40 行

HTM
40
字号
<html>
<head>
<title>淡入淡出的文字效果</title>
<style type="text/css">
<!--
	#txt{
		color:#FFFFFF;
		font-weight:bold;
		font-size:40pt;
	}
-->
</style>
<script language="javascript">
<!--
	i = 1;
	control = true;
	function alp(){
		txt.style.width = 300;
		txt.style.filter = "alpha(opacity=" + i + ")";
		if(control && i<100){
			i++;
		}else{
			control = false;
		}
		if(!control && i>0){
			i--;
		}else{
			control = true;
		}
		setTimeout("alp()",50);
	}
//-->
</script>
</head>
<body onLoad="alp()" bgcolor="#000000">
<div style="color:#FFFFFF" id="txt">
淡入淡出的文字效果
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?