脚本说明:
第一步:把如下代码加入%26lt;body%26gt;区域中:
%26lt;script LANGUAGE=%26quot;JavaScript%26quot;%26gt;
var text = %26quot;在输入栏里您输入什么我就能显示什么!!!%26quot;;
var total_length = 60; // length of string+spaces
function doShoot(msg) {
var status_message = %26quot;%26quot;;
var assembling = %26quot;%26quot;;
this.status = status_message;
var index = 0;
var location = 0, i;
// now shoot one letter at a time
for(i=0; i %26lt; msg.length; i++) { // moves through the message
for(j=total_length-status_message.length; j %26gt; -1;j--) {
// see how many spaces have to be added
assembling = %26quot;%26quot;;
for(var k=0; k %26lt; j; k++)
assembling += %26quot; %26quot;;
assembling += msg.charAt(i);
this.status=status_message +assembling;
}
status_message += assembling;
}
}
%26lt;/script%26gt;
%26lt;form name=%26quot;shooterform%26quot; method=%26quot;get%26quot;%26gt;
%26lt;p%26gt;%26lt;input type=%26quot;text%26quot; name=%26quot;shoot_text%26quot; size=%26quot;20%26quot;%26gt; %26lt;input type=%26quot;button%26quot; name=%26quot;trigger%26quot;
value=%26quot;请输入%26quot; onclick=%26quot;doShoot(shoot_text.value)%26quot;%26gt; %26lt;/p%26gt;
%26lt;/form%26gt;
第二步:把%26lt;body%26gt;中的内容改为
%26lt;body bgcolor=%26quot;#fef4d9%26quot; onload=%26quot;doShoot(text)%26quot;%26gt;

