当前位置:开发者网络 >> 网页特效 >> 状态栏类 >> 内容
精彩推荐
分类最新特效
分类热点特效
  
在输入框中输入什么,就会在状态栏显示什么
日期:2005-06-10   人气:   【字体: 】【收藏此文


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 2 个步骤: -->

<!-- 第 1 步: -->
<!-- 把<BODY>中的属性代码改为: -->

<BODY bgcolor="#fef4d9" onload="doShoot(text)">



<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<script LANGUAGE="JavaScript">

var text = "在输入栏里您输入什么我就能显示什么!!!";
var total_length = 60; // length of string+spaces

function doShoot(msg) {
var status_message = "";
var assembling = "";
this.status = status_message;
var index = 0;
var location = 0, i;
// now shoot one letter at a time
for(i=0; i < msg.length; i++) { // moves through the message
for(j=total_length-status_message.length; j > -1;j--) {
// see how many spaces have to be added
assembling = "";
for(var k=0; k < j; k++)
assembling += " ";
assembling += msg.charAt(i);
this.status=status_message +assembling;
}
status_message += assembling;
}
}
</script>



<form name="shooterform" method="get">

<p><input type="text" name="shoot_text" size="20" style="border: 1 solid #0099FF"> <input type="button" name="trigger"

value="看看" onclick="doShoot(shoot_text.value)" style="color: #FFFFFF; background-color: #0099FF; border: 1 solid #0099FF" border=0>

<input type="reset" value="重写" name="B1" style="color: #FFFFFF; background-color: #0099FF; border: 1 solid #0099FF" border=0> </p>

</form>