游客:
注册
|
登录
|
帮助
网友俱乐部
»
网页制作
»
Javascript教程
» 精彩的变色文字
网友生活网
|
网友学堂
如何获得金币?
诚招斑竹
IP归属地查询 PR查询 收录查询 whois查询
免费超短2级域名,your.jpy.cc
传世私服
|
传奇世界私服
注册亚洲交友中心,找个人来同居吧!
7CODE查杀恶意代码,守护您的电脑
‹‹ 上一主题
|
下一主题 ››
投票
交易
悬赏
活动
打印
|
推荐
|
订阅
|
收藏
标题: 精彩的变色文字
ljjk5
元帅
UID 46706
精华
1
积分 99426
帖子 49691
威望 554
金币 48489
热心 505
阅读权限 100
注册 2007-2-25
状态 离线
#1
使用道具
发表于 2007-4-8 09:15
资料
个人空间
主页
短消息
加为好友
精彩的变色文字
脚本说明:
把如下代码加入<body>区域中
<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
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
+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>
网友
ljjk5
签名 - 网友社区
===
[广告]
免费域名(Free Subdomain)
免费空间(Free hosting)
PR查询(Google Pagerank)
投票
交易
悬赏
活动
控制面板首页
编辑个人资料
积分交易
公众用户组
好友列表
个人空间管理
基本概况
流量统计
客户软件
发帖量记录
论坛排行
主题排行
发帖排行
积分排行
在线时间
管理团队
管理统计
当前时区 GMT+8, 现在时间是 2008-9-7 20:02
信产部ICP备案:
京ICP备05066424号
北京市公安局网监备案:1101050648号
Powered by
Discuz!
5.5.0
TOP
清除 Cookies
-
联系我们
-
网友俱乐部
-
Archiver
-
WAP