200、文字动态变化

200、文字动态变化

脚本说明:

 

把如下代码加入<body>区域中

 

<SCRIPT language=JavaScript><!-- Begin

 

var speed = 20;

 

var cycledelay = 1000;

 

var maxsize = 48;

 

 

 

var x = 0;

 

var y = 0;

 

var themessage, size;

 

var esize = "";

 

 

 

function initArray() {

 

this.length = initArray.arguments.length;

 

for (var i = 0; i < this.length; i++) {

 

this[i] = initArray.arguments[i];

 

   }

 

}

 

var themessage2 = new initArray(

 

"欢迎访问......",

 

"网页之作.....",

 

"冰峰工作室向你问好.....!",

 

"谢谢你的访问....."

 

);

 

if(navigator.appName == "Netscape")

 

document.write('<layer id="wds"></layer><br>');

 

if (navigator.appVersion.indexOf("MSIE") != -1)

 

document.write('<span id="wds"></span><br>');

 

function upwords(){

 

themessage = themessage2[y];

 

if (x < maxsize) {

 

x++;

 

setTimeout("upwords()",speed);

 

}

 

else setTimeout("downwords()",cycledelay);

 

 

 

if(navigator.appName == "Netscape") {

 

size = "<font point-size='"+x+"pt'>";

 

document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);

 

document.wds.document.close();

 

}

 

if (navigator.appVersion.indexOf("MSIE") != -1){

 

wds.innerHTML = "<center>"+themessage+"</center>";

 

wds.style.fontSize=x+'px'

 

   }

 

}

 

function downwords(){

 

if (x > 1) {

 

x--;

 

setTimeout("downwords()",speed);

 

}

 

else {

 

setTimeout("upwords()",cycledelay);

 

y++;

 

if (y > themessage2.length - 1) y = 0;

 

}

 

if(navigator.appName == "Netscape") {

 

size = "<font point-size='"+x+"pt'>";

 

document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);

 

document.wds.document.close();

 

}

 

if (navigator.appVersion.indexOf("MSIE") != -1){

 

wds.innerHTML = "<center>"+themessage+"</center>";

 

wds.style.fontSize=x+'px'

 

   }

 

}

 

setTimeout("upwords()",speed);

 

//  End -->

 

</SCRIPT>

 

Write a comment

Comments: 0