站 内 搜 索
热门特效推荐
您当前位置:
中国素材首页
>>
网页特效
>>
状态栏
>> 输入文字,然后在状态栏里显示
输入文字,然后在状态栏里显示
中国素材网 www.sucai86.com 2006-1-9 16:14:14 流量数:
在输入框中输入什么,就会在状态栏显示什么,而且是特效显示
[
查看演示
] 源码如下
----------------------------------------------------------------------------------------
<form name="shooterform" method="get">
<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>
<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>
----------------------------------------------------------------------------------------
欢迎来到中国素材网!