腳本說明:
把如下代碼加入<body>區(qū)域中
<script language="Javascript">
/* This script was made by Erik. You can contact him me worfy@geocities.com or at my homepage www.geocities.com/Area51/Corridor/4090. I know that it doesn‘t look pretty in the source code, but that couldn‘t be helped. Feel free to modify this script in any way but please give me credit. This is my first real script.
BTW for you yankees, I spell colour with the U because I‘m Canadain.*/
hexa = new MakeArray(16)
hexa[10] = "A"
hexa[11] = "B"
hexa[12] = "C"
hexa[13] = "D"
hexa[14] = "E"
hexa[15] = "F"
function MakeArray(n)
{
this.length = n
for (var i = 0; i <= n; i++)
this[i] = i
return this
}
function colours(text){
var posa = 0
var posb = 1
while (posa <= text.length){
var r = Math.floor(Math.random() * 15)
var rr= Math.floor(Math.random() * 15)
var g = Math.floor(Math.random() * 15)
var gg = Math.floor(Math.random() * 15)
var b = Math.floor(Math.random() * 15)
var bb = Math.floor(Math.random() * 15)
if (text.substring(posa,posb) == "<"){
var posaa = 0
posaa = posa
while (text.substring(posaa,posb) != ">"){
posaa++
posb++
}
document.write(text.substring(posa, posb))
posa = posb
posb = posa + 1
}
document.write("<font color=#"+hexa[r]+hexa[rr]+hexa[g]+hexa[gg]+hexa[b]+hexa[bb]+">")
document.write(text.substring(posa, posb)+"</font>")
posa++
posb++
}
}
</script>
<script language = "javascript">
text = "This Javascript shows every other letter of text as a different, random colour."
text +="You can also use any <blink> <font size=9> HTML </font> </blink> codes that you want"
text +=" As long as you don‘t use quotation marks and the commands have a space between them."
text +=" You can use any background colour or picture that you want, but black or white is sugeste"
text +="d <b> <u>HAVE FUN!!! </u> </b>"
colours(text)
</script>
北京 | 天津 | 上海 | 江蘇 | 山東 |
安徽 | 浙江 | 江西 | 福建 | 深圳 |
廣東 | 河北 | 湖南 | 廣西 | 河南 |
海南 | 湖北 | 四川 | 重慶 | 云南 |
貴州 | 西藏 | 新疆 | 陜西 | 山西 |
寧夏 | 甘肅 | 青海 | 遼寧 | 吉林 |
黑龍江 | 內(nèi)蒙古 |