165、文字逐个变成大写

165、文字逐个变成大写

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

ripplespeed = 300; // lower = faster

string = "Welcome to the www.7stk.com";

 

function rippleText() {

box = document.scrollform.box; // box to display text in

arg0 = rippleText.arguments[0];

i = (arg0) ? ( (arg0 == string.length) ? 0 : arg0) : 0;

 

box.value = string.substring(0,i)

+ (string.substring(i,i+1).toUpperCase())

+ string.substring(i+1, string.length);

 

scrollcmd = "rippleText("+(i+1)+")";

timer = window.setTimeout(scrollcmd, ripplespeed);

}

//  End -->

</script>

<center>

<form name=scrollform>

<input type=text name=box size=30>

</form>

</center>

 

 

 

第二步:把<body>区域中的内容改为

<body bgcolor="#fef4d9" OnLoad="rippleText()">

 

Write a comment

Comments: 0