| 特效代码文字篇 | (微笑) 具有打字机特效的状态栏文字
<script Language="javascript"> var msg = "这里是打字机特效的文字!!!" ; var interval = 100 var spacelen = 120; var space10=" "; var seq=0; function Scroll() { len = msg.length; window.status = msg.substring(0, seq+1); seq++; if ( seq >= len ) { seq = 0; window.status = ''; window.setTimeout("Scroll();", interval ); } else window.setTimeout("Scroll();", interval ); } Scroll(); </script>
随鼠飞扬的文字
<style type="text/css"> .spanstyle { position:absolute; visibility:visible; top:-50px; font-size:9pt; font-family:宋体; color: 000000; font-weight:bold; }</style> <script> var x,y var step=20 var flag=0 var message="感谢您光临英雄无敌社团" message=message.split("") var xpos=new Array() for (i=0;i<=message.length-1;i++) { xpos[i]=-50} var ypos=new Array() for (i=0;i<=message.length-1;i++) { ypos[i]=-50} function handlerMM(e){ x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY flag=1} function makesnake() { if (flag==1 && document.all) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("span"+(i)+".style") thisspan.posLeft=xpos[i] thisspan.posTop=ypos[i] } } else if (flag==1 && document.layers) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("document.span"+i) thisspan.left=xpos[i] thisspan.top=ypos[i]} } var timer=setTimeout("makesnake()",30)} </script> <body onLoad="makesnake()" > <script> for (i=0;i<=message.length-1;i++) { document.write("<span id='span"+i+"'class='spanstyle'>") document.write(message[i]) document.write("</span>")} if (document.layers){ document.captureEvents(Event.MOUSEMOVE);} document.onmousemove = handlerMM; </script>
说明:将文字的地方改成你需要的颜色和文字!
让人感到心跳的文字
<p align="center"><!--webbot bot="HTMLMarkup" startspan --><style> <!-- #glowtext{ filter:glow(color=0A9DF5,strength=2); width:100%; } --> </style> <script language="javascript1.2"> function glowit(which){ if (document.all.glowtext[which].filters[0].strength==2) document.all.glowtext[which].filters[0].strength=1 else document.all.glowtext[which].filters[0].strength=2 } function glowit2(which){ if (document.all.glowtext.filters[0].strength==2) document.all.glowtext.filters[0].strength=1 else document.all.glowtext.filters[0].strength=2 } function startglowing(){ if (document.all.glowtext&&glowtext.length){ for (i=0;i<glowtext.length;i++) eval('setInterval("glowit('+i+')",150)') } else if (glowtext) setInterval("glowit2(0)",150) } if (document.all) window.onload=startglowing </script> <span id="glowtext"><font color="F5D20A" " face="楷体_GB2312" size="3">欢迎光临英雄无敌社团</font></span> <!--webbot bot="HTMLMarkup" endspan --> </p>
状态栏文字从右向左移动
<script> function scrollit_r2l(seed) { var m1 = " 哈哈哈,我从右向左移!!!" ; var m2 = " " ; var msg=m1+m2; var out = " "; var c = 1; var speed = 100 if (seed > 100) { seed-=2; var cmd="scrollit_r2l(" + seed + ")"; timerTwo=window.setTimeout(cmd,speed);} else if (seed <= 100 && seed > 0) { for (c=0 ; c < seed ; c++) { out+=" ";} out+=msg; seed-=2; var cmd="scrollit_r2l(" + seed + ")"; window.status=out; timerTwo=window.setTimeout(cmd,speed); } else if (seed <= 0) { if (-seed < msg.length) { out+=msg.substring(-seed,msg.length); seed-=2; var cmd="scrollit_r2l(" + seed + ")"; window.status=out; timerTwo=window.setTimeout(cmd,speed);} else { window.status=" "; timerTwo=window.setTimeout("scrollit_r2l(100)",speed); } } } scrollit_r2l(100); // -- End of javascript code --> </script>
说明:将上面代码中的文字改为你需要的就行了!
华彩文字
<p align="center"><font face="华文彩云" color="#FFFF00"> <script language="javascript"> <!-- Begin text = "欢迎来到英雄无敌"; //显示的文字 color1 = "blue"; //文字的颜色 color2 = "yellow"; //转换的颜色 fontsize = "8"; //字体大小 speed = 100; //转换速度 (1000 = 1 秒) i = 0; if (navigator.appName == "Netscape") { document.write("<layer id=a visibility=show></layer><br><br><br>"); } else { document.write("<div id=a></div>"); } function changeCharColor() { if (navigator.appName == "Netscape") { document.a.document.write("<center><font face=arial size =" + fontsize + "><font color=" + color1 + ">"); for (var j = 0; j < text.length; j++) { if(j == i) { document.a.document.write("<font face=arial color=" + color2 + ">" + Text.charAt(i) + "</font>"); } else { document.a.document.write(text.charAt(j)); } } document.a.document.write('</font></font></center>'); document.a.document.close(); } if (navigator.appName == "Microsoft Internet Explorer") { str = "<center><font face=arial size=" + fontsize + "><font color=" + color1 + ">"; for (var j = 0; j < text.length; j++) { if( j == i) { str += "<font face=arial color=" + color2 + ">" + text.charAt(i) + "</font>"; } else { str += text.charAt(j); } } str += "</font></font></center>"; a.innerHTML = str; } (i == text.length) ? i=0 : i++; } setInterval("changeCharColor()", speed); // End --> </script> </font> </p>
层出不穷的文字
<SCRIPT>
messages = new Array() messages[0] = "最近我有三个心愿" messages[1] = "第一我要中500万" messages[2] = "第二我要强壮" messages[3] = "第三我要睡觉" messages[4] = "英雄无敌" messages[5] = "。"
mescolor = new Array() mescolor[0] = "FF9900" mescolor[1] = "FF0000" mescolor[2] = "008800" mescolor[3] = "0000FF" mescolor[4] = "888800" mescolor[5] = "888800"
messize = new Array() messize[0] = "40pt" messize[1] = "50pt" messize[2] = "55pt" messize[3] = "45pt" messize[4] = "50pt" messize[5] = "40pt"
var i_messages = 0 var timer
function dotransition() { if (document.all) { content.filters[0].apply() content.innerHTML = "<span style='color:"+mescolor[i_messages]+";font-size:"+messize[i_messages]+";filter: revealTrans(Transition=12, Duration=3)'>"+messages[i_messages]+"</span>" content.filters[0].play() if (i_messages >= messages.length-1) { i_messages = 0 } else { i_messages++ } }
if (document.layers) { document.content.document.write("<span style='color:"+mescolor[i_messages]+"'>"+messages[i_messages]+"</span>") if (i_messages >= messages.length-1) { i_messages = 0 } else { i_messages++ } } timer = setTimeout("dotransition()",4000) }
</SCRIPT>
第二步:在<body>加入执行命令 onload=dotransition() 第三步:在<body>与</body>之间加入下页结束语 <DIV id=content style="FILTER: revealTrans(Transition=12, Duration=2); HEIGHT: 100px; LEFT: 30px; POSITION: absolute; TEXT-ALIGN: center; TOP: 1px; WIDTH: 660px"></DIV>
| |
|