·您的位置: 首页 » 资源教程 » 编程开发 » JavaScript » 5、淡入淡出的文字

5、淡入淡出的文字

类别: JavaScript教程  评论数:0 总得分:0
====1、以下代码放在HTML的<head></head>之间:

<script language="javaScript">
<!--
function checkBrowserForVersion4(){
var x=navigator.appVersion;
y=x.substring(0,4);
if(y>=4) Effect();}
var isNav=(navigator.appName.indexOf("Netscape")!=-1);
var colors=new Array
("FFFFFF","FFFFFF","FFFFFF","FFFFFF"
,"FFFFFF","FFFFFF","FFFFFF","F9F9F9"
,"F1F1F1","E9E9E9","E1E1E1","D9D9D9"
,"D1D1D1","C9C9C9","C1C1C1","B9B9B9"
,"B1B1B1","A9A9A9","A1A1A1","999999"
,"919191","898989","818181","797979"
,"717171","696969","616161","595959"
,"515151","494949","414141","393939"
,"313131","292929","212121","191919","111111","090909","000000")
a=0,b=1
function Effect(){
color=colors[a];
//*改改下面的文字内容即可,可使用HTML语法,但是注意引号不要混用。双引号内是单引号。*//
aa="<font size=\'5\'><font face=\'Arial, Helvetica, sans-serif\'><font color="+color+">Save page and Get Code !<p>Enjoy All These Free Javascripts ......</font></font></font>"
if(isNav) {document.object1.document.write(aa);document.object1.document.close();}
else object1.innerHTML=aa
a+=b;if (a==38) b-=2;if (a==0) b+=2;xx=setTimeout("Effect()",10);}
//-->
</script>

====2、以下代码放在HTML的<body></body>之间[适当的位置]:
<body onload="checkBrowserForVersion4()" >
<div id="object1" style="position:absolute; visibility:show; left:181px; top:113px; z-index:2"></div>

====3、特别说明:只要改变上面的TOP值和LEFT值即可确定文字显示的绝对位置。TOP表示文字距离屏幕顶部的距离(象素),LEFT是离屏幕左侧的距离。上面有一大堆乱七八糟的字符是确定渐变的颜色数组。
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1