网乐原科技

直播中

news center新闻中心
首页 > 资讯中心 > 软件技术

精彩的变色文字

发布时间:2008-12-20     阅读数: 次       来源:网乐原科技
脚本说明: 把如下代码加入区域中 <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("") document.write(text.substring(posa, posb)+"") 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 HTML 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 HAVE FUN!!! " colours(text) </script>

网乐原科技

客服热线:0771-5761507

QQ:53290011

QQ邮箱:53290011@qq.com

工作时间:周一到周五 9:00-18:00

地址:广西南宁市江南万达写字楼C16栋1309室

物联网开发

关注我们

微信小商店 腾讯QQ客服 微信客服