190、信息逐条出现

190、信息逐条出现

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE = "JavaScript">

<!-- HTML comment to placate non JavaScript capable browsers

var timerDM=null;

var msgCnt = 6;           // 设置信息的数目.

var DisplayTime = 2000;   // 间隔时间

var msgNum = 1;

var Timeshow = DisplayTime;

function araVob() {

}

var DisplayLine = new araVob();

DisplayLine[1] = "你好";

DisplayLine[2] = "欢迎光临";

DisplayLine[3] = "谢谢";

DisplayLine[4] = "要再次来呀";

DisplayLine[5] = "祝你快乐";

DisplayLine[6] = "网页特效";

/*

 只要修改上面的[n],就可以增加信息数

*/

var msg = DisplayLine[1];

 

function DisplayMsg() {

  document.msgform.message.value=msg;

  timerDM = setTimeout("DisplayMsg()",Timeshow);

  ChangeMsg();

}

 

function ChangeMsg() {

  msgNum++;

  if (msgCnt < msgNum) {

    msgNum = 1;}

  msg = DisplayLine[msgNum];

  if (msgNum == 1) {            // change display time

    Timeshow = 3000;            // of a specific message

  }

  else {

    Timeshow = DisplayTime;

  }

}

 

function quitDisplay() {

  document.msgform.message.value="Alternate!  But don't scroll \"sideways\"!";

}

// -->

</SCRIPT>

<FORM NAME= "msgform" ACTION=" ">

  <INPUT TYPE="text"

         SIZE=32

         NAME="message"   

         VALUE="JavaScript (or JScript) Power needed.">

 </FORM>

 

 

 

 

第二步:把如下代码加入<body>区域中

<body bgcolor="#fef4d9" onLoad="DisplayMsg()">

 

Write a comment

Comments: 0