|
|
一些常用HTML代碼
將代碼中的文字修改為自己所需要的字
學(xué)過(guò)C程的可以自己修改代碼
學(xué)過(guò)HTML的可以自己寫(xiě)代碼
都不會(huì)的就照著用
要將代碼段復(fù)制到[Discuz!代碼模式]下 并將頁(yè)面左下方的[啟用Html代碼]勾選 切記!
火燒文字:
(換字就可以用了,在代碼的開(kāi)頭有一處color=red可以換成其他顏色,顏色也可以用其他形式表達(dá),如:#FF0000)
<style>#glowtext{filter:glow(color=red,strength=2);width:100%;}</style>
<script>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>
<div align=center><span id="glowtext" align=center style="font-size:30">歡迎來(lái)到浙江科技學(xué)院和山論壇</span></div>
文字逐個(gè)閃爍:
(如果要改字的個(gè)數(shù),請(qǐng)將代碼中的幾處4改為你要的字的個(gè)數(shù),代碼中的前一個(gè)顏色是閃爍的顏色,后一個(gè)是不閃爍的顏色)
<script>var temp_i=1;function flash_sms(){for (i=1;i<=4;i++){if (i==temp_i) temp_str="#ff3300"; else temp_str="#336699";eval("a"+i+".style.color="+"temp_str"+";");}temp_i++;if (temp_i>4) temp_i=1;};setInterval("flash_sms()",200);</script>
<SPAN id=a1>和</SPAN><SPAN id=a2>山</SPAN><SPAN id=a3>論</SPAN><SPAN id=a4>壇</SPAN>
彩色漸變:
(改“ 我愛(ài)和山論壇 ”的時(shí)候不要?jiǎng)h掉文字前的三個(gè)空格和后面的四個(gè)空格)
<script>function MakeArray(n){this.length=n;for(var i=1; i<=n; i++) this=i-1;return this};hex=new MakeArray(16);hex[11]="A";hex[12]="B";hex[13]="C";hex[14]="D";hex[15]="E";hex[16]="F";function ToHex(x){var high=x/16;var s=high+"";s=s.substring(0,2);high=parseInt(s,10);var left=hex[high+1];var low=x-high*16;s=low+"";s=s.substring(0,2);low=parseInt(s,10);var right=hex[low+1];var string=left+""+right;return string;};function rainbow(text){text=text.substring(3,text.length-4);color_d1=255;mul=color_d1/text.length;for(i=0;i<text.length;i++){color_d1=255*Math.sin(i/(text.length/3));"255*Math.sin(i/(text.length/3))";color_h1=ToHex(color_d1);color_d2=mul*i;color_h2=ToHex(color_d2);document.write("<FONT COLOR=#FF"+color_h1+color_h2+">"+text.substring(i,i+1)+"</FONT>");}}</script>
<script>{rainbow(" 我愛(ài)和山論壇 ");}</script>
一個(gè)個(gè)變色文字:
(red和black處是定義顏色的,http://www.h3bbs.com處定義的是鏈接,100是速度,越小越快)
<script>var message="歡迎來(lái)到和山論壇";var ne;var ne;var flashspeed=100;var n=0;
if (document.all){document.write('<font color='+neonbasecolor+'>');for (m=0;m<message.length;m++)document.write('<a href=http://www.h3bbs.com><span id=neonlight>'+message.charAt(m)+'</span></a>');document.write('</font>');var tempref=document.all.neonlight}else document.write(message);function neon(){if(n==0){for(m=0;m<message.length;m++)tempref[m].style.color=neonbasecolor};tempref[n].style.color=neontextcolor;if(n<tempref.length-1)n++;else{n=0;clearInterval(flashing);setTimeout("beginneon()",1500);return}};function beginneon(){if (document.all)flashing=setInterval("neon()",flashspeed)};beginneon()</script>
WAVE文字:
(36控制字體大小,數(shù)字越大,字體越大,100控制速度,數(shù)字越小速度越快,#ff0000控制顏色)
<DIV id=theDiv align=center></DIV>
<SCRIPT language=JavaScript>function nextSize(i,incMethod,textLength){if(incMethod==1)return(36*Math.abs(Math.sin(i/(textLength/3.14))));if(incMethod==2)return(255*Math.abs(Math.cos(i/(textLength/3.14))))};function sizeCycle(text,method,dis){output="";for(i=0;i<text.length;i++){size=parseInt(nextSize(i+dis,method,text.length));output +="<font style=font-size:"+size+"pt;color:#ff0000>"+text.substring(i,i+1)+"</font>";}theDiv.innerHTML=output;};function doWave(n){theText="我愛(ài)和山論壇";sizeCycle(theText,1,n);if(n>theText.length){n=0};setTimeout("doWave("+(n+1)+")",100);}</SCRIPT><SCRIPT>doWave(0)</SCRIPT> |
|