824text6.htm

来自「javascript各种效果的实例及源代码」· HTM 代码 · 共 142 行

HTM
142
字号
<html>
<head>
<title>文字逐个出现</title>
<style type="text/css">
<!--
body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#fef4d9" onload="capswitch()">  
<br>
<br>
<center><font color=red face="隶书" size=6>文字逐个出现</font></center>
<br>
<center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面为效果显示区!</strong></font></td></tr>
<tr><td align=center><script lanuage="JavaScript">

var count = -1;
var counter;
var nchar
var speedtogo = 200

var a = new Array();

a[1] = "网页特效欢迎你的光临";
a[2] = "";


function capswitch() {
 count++
 if(count == 0){
   document.wow.display.value = a[1]
  }
 if(count == 1){
    document.wow.display.value = a[2].substring(0, 1) +
a[1].substring(20, 1) 
        }
 if(count > 1){
   a[3] = a[1].substring(0, count - 1) + a[2].substring(count - 1,
count) + a[1].substring(20, count)
  document.wow.display.value = a[3]
 }
 if(count == a[1].length){
    count = -1
  }

         counter    = setTimeout("capswitch()",speedtogo);

 }


</script>
<form name="wow">
<input type="text" size="20" name="display" value="">
</form>
</td></tr>
</table></center>
<br>
<br>
<center>
<textarea name=source rows=12 cols=45 class=yk9>
脚本说明:
第一步:把如下代码加入<body>区域中
<script lanuage="JavaScript">

var count = -1;
var counter;
var nchar
var speedtogo = 200

var a = new Array();

a[1] = "网页特效欢迎你的光临";
a[2] = "";


function capswitch() {
 count++
 if(count == 0){
   document.wow.display.value = a[1]
  }
 if(count == 1){
    document.wow.display.value = a[2].substring(0, 1) +
a[1].substring(20, 1) 
        }
 if(count > 1){
   a[3] = a[1].substring(0, count - 1) + a[2].substring(count - 1,
count) + a[1].substring(20, count)
  document.wow.display.value = a[3]
 }
 if(count == a[1].length){
    count = -1
  }

         counter    = setTimeout("capswitch()",speedtogo);

 }


</script>
<form name="wow">
<input type="text" size="20" name="display" value="">
</form>



第二步:把如下代码加入<body>区域中
<body bgcolor="#fef4d9" onload="capswitch()">  
</textarea>
<SCRIPT LANGUAGE="JavaScript">

<!-- hide

function goHist(a) 

{

   history.go(a);

}

//-->

</script>

<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">
</form>
</center>
<br>
<br>
</body>
</html>

⌨️ 快捷键说明

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