21 123
发新话题
打印

[分享] 『hjy,AN+』■■文字效果集合------求精---求入新手教程贴

『hjy,AN+』■■文字效果集合------求精---求入新手教程贴


  --------更多内容请看暗域世界

放在什么地方随便你用拉,建议用在论坛简介里面


由于许多都是动态的,没法贴图。我会在我论坛上展示其效果连接地址:http://anyu.ent.topzj.com/forumdisplay.php?fid=163137&page=1



1.文字一个一个输出,象打字效果一样
复制内容到剪贴板
代码:
<DIV class=ttl1 id=ttl0><SPAN class=ttl1></SPAN></DIV>
<SCRIPT language="JavaScript">var layers=document.layers,style=document.all,both=layers || style,idme=908601;if (layers){layerRef='document.layers';styleRef='';};if(style){layerRef='document.all';styleRef='.style';};function writeOnText(obj, str){if(layers)with(document[obj]){document.open();document.write(str);document.close();};if (style)eval(obj+'.innerHTML=str');};var dispStr=new Array("<font color=red size=3>哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈</font><br><font color=green size=3>呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵</font><br><font color=red size=3>暗域暗域暗域暗域暗域暗域暗域暗域暗域</font><br><font color=blue size=3>HOHOHOHOHOHOHOHOOHOHOHOHO</font><br><font color=red size=3>欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎</font>");var overMe=0;function txtTyper(str, idx, idObj, spObj, clr1, clr2, delay, plysnd){ var tmp0 = tmp1 = '', skip = 0;if (both && idx <= str.length) {if (str.charAt(idx) == '<') { while (str.charAt(idx) != '>') idx++; idx++; };if (str.charAt(idx) == '&' && str.charAt(idx+1) != ' ') { while (str.charAt(idx) != ';') idx++; idx++; };tmp0 = str.slice(0,idx);tmp1 = str.charAt(idx++);if (overMe==0 && plysnd==1){if(navigator.plugins[0]){if(navigator.plugins["LiveAudio"][0].type=="audio/basic" && navigator.javaEnabled()){document.embeds[0].stop();setTimeout("document.embeds[0].play(false)",100);}} else if(document.all){ding.Stop();setTimeout("ding.Run()",100);}; overMe=1;} else overMe=0;writeOnText(idObj, "<span class="+spObj+"><font color='"+clr1+"'>"+tmp0+"</font><font color='"+clr2+"'>"+tmp1+"</font></span>");setTimeout("txtTyper('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+" ,"+plysnd+")",delay);}};function init(){txtTyper(dispStr[0], 0, 'ttl0', 'ttl1', '#339933', '#99FF33', 50, 0);}</SCRIPT><SCRIPT>init()</SCRIPT>
2.鼠标悬停在链接上时,链接说明文字不停的流动
复制内容到剪贴板
代码:
<SCRIPT LANGUAGE="JavaScript">var a,b,go,word;function greenlight(word){a="这儿是滚动的文字";word.style.color="red";linkSwitch();};function linkSwitch(){clearTimeout(go);b=a;a=a.substring(1,100)+a.charAt(0);esh.innerText=a;go=setTimeout("linkSwitch()",100);};function stp(word){clearTimeout(go);esh.innerText="鼠标离开之后的文字";word.style.color="blue";}</SCRIPT>

<A HREF="http://netshfun.clubhi.com" onmouseover="greenlight(this)"; onmouseout="stp(this)"><span id="esh"> 鼠标放上之前的文字</span></A>
3.火烧文字,用来做标题
复制内容到剪贴板
代码:
<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">欢迎访问[暗域世界]</span></div>
4.常用来做标题的代码1
复制内容到剪贴板
代码:
<div style="width:100%;filter:glow(color=#ff0000,strength=5);"><p style='font-size:38;color=#ffffff;' align=center>用这个做标题</p></div>
5.常用来做标题的代码2
复制内容到剪贴板
代码:
<div style="width:100%;filter:blur(add=true,direction=135,strength=10);"><p style='font-size:38;color=#ff0000;font-family:黑体' align=center>用这个做标题</p></div>
6.文字逐个闪烁,有点儿Flash的味道
复制内容到剪贴板
代码:
<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>
7.文字动态变化
复制内容到剪贴板
代码:
<SCRIPT>var speed = 20;var cycledelay = 1000;var maxsize = 48;var x = 0;var y = 0;var themessage, size;var esize = "";function initArray(){this.length = initArray.arguments.length;for(var i=0;i<this.length;i++){this[i] = initArray.arguments[i];}};var themessage2 = new initArray("欢迎来访","论坛乐趣","祝你在这儿开心!","谢谢访问");if(navigator.appName == "Netscape")document.write('<layer id=wds></layer><br>');if (navigator.appVersion.indexOf("MSIE") != -1)document.write('<span id=wds></span><br>');function upwords(){themessage = themessage2[y];if (x<maxsize){x++;setTimeout("upwords()",speed);};else setTimeout("downwords()",cycledelay);if(navigator.appName == "Netscape"){size = "<font point-size="+x+"pt>";document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);document.wds.document.close();};if(navigator.appVersion.indexOf("MSIE") != -1){wds.innerHTML = "<center>"+themessage+"</center>";wds.style.fontSize=x+'px'}};function downwords(){if(x>1){x--;setTimeout("downwords()",speed);};else{setTimeout("upwords()",cycledelay);y++;if(y>themessage2.length - 1) y=0;};if(navigator.appName=="Netscape"){size="<font point-size="+x+"pt>";document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);document.wds.document.close();};if(navigator.appVersion.indexOf("MSIE")!=-1){wds.innerHTML="<center>"+themessage+"</center>";wds.style.fontSize=x+'px'}};setTimeout("upwords()",speed);</SCRIPT>
[ 本帖最后由 城市困兽 于 2006-11-11 02:29 编辑 ]
附件: 您所在的用户组无法下载或查看附件

TOP

8.彩色渐变文字
复制内容到剪贴板
代码:
<script>function MakeArray(n){this.length=n;for(var i=1; i<=n; i++) this[i]=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("   江山如此多娇,引无数英雄竞折腰    ");}</script>
9.文字不停的变颜色,用来做提醒还不错
复制内容到剪贴板
代码:
<SCRIPT>function initArray(){this.length=initArray.arguments.length;for(var i=0;i<this.length;i++){this[i]=initArray.arguments[i];}};var ctext = "文字不停变色";var speed=1000;var x=0;var color=new initArray("#ffff00","#ff0000","#ff00ff","#0000ff","#ffffff","#000000","#00ff00","#00ffff","#ff0ff0");if(navigator.appName=="Netscape"){document.write('<layer id=c><center>'+ctext+'</center></layer><br>');};if(navigator.appVersion.indexOf("MSIE")!=-1){document.write('<div id=c><center><b>'+ctext+'</b></center></div>');};function chcolor(){if(navigator.appName=="Netscape"){document.c.document.write('<center><font color='+color[x]);document.c.document.write('>'+ctext+'</font></center>');document.c.document.close();}else if(navigator.appVersion.indexOf("MSIE") != -1){document.all.c.style.color = color[x];};(x<color.length-1) ? x++:x=0;}setInterval("chcolor()",200);</SCRIPT>
10.在页面内可以用鼠标拖动的文字
复制内容到剪贴板
代码:
<STYLE>.drag {CURSOR: hand; POSITION: relative}</STYLE>

<SCRIPT language=JavaScript>var dragapproved=false;var z,x,y;function move(){if(event.button==1&&dragapproved){z.style.pixelLeft=temp1+event.clientX-x;z.style.pixelTop=temp2+event.clientY-y;return false;}};function drags(){if(!document.all) return;if(event.srcElement.className=="drag"){dragapproved=true;z=event.srcElement;temp1=z.style.pixelLeft;temp2=z.style.pixelTop;x=event.clientX;y=event.clientY;document.onmousemove=move}};document.onmousedown=drags;document.onmouseup=new Function("dragapproved=false");</SCRIPT>

<SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体"><FONT class=drag style="CURSOR: move" color=#cc0000>将鼠标按在这些字上移动鼠标试试看!</FONT></SPAN>
11.一个个变色的文字,用来提醒某一个链接很好的
复制内容到剪贴板
代码:
<script>var message="一个个变色的文字,还可以加上链接的哦,用来提醒某一个链接很好的";var neonbasecolor='red';var neontextcolor='black';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://netshfun.clubhi.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>
12.滚动的文字,常用做来做公告和链接
复制内容到剪贴板
代码:
<marquee width='300' onmouseover='scrollAmount=0' direction='up' scrollAmount='2' onmouseout='scrollAmount=2' height='100' bgcolor=#f0f0f0 style='font-size:9pt;border: #000000; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px '><p>欢迎来到[暗域论坛]<br>为您提供代码<br>这里面可以加上图片<img src=http://i6677.com/fun/aaa/1.gif border=0 align="absmiddle"> <br>还可以加上<a href=http://netsh.com>链接</a><p></p></marquee>
13.波形文字,做标题也不错的
复制内容到剪贴板
代码:
<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="netshfun.clubhi.com";sizeCycle(theText,1,n);if(n>theText.length){n=0};setTimeout("doWave("+(n+1)+")",100);}</SCRIPT><SCRIPT>doWave(0)</SCRIPT>
14.点击文字出现链接,有点儿象菜单的味道
复制内容到剪贴板
代码:
<div id=Out0 style="position:relative; left:20; top:+15px; width:90%;" ><span id=Out1 class=Outline style="hand: hand; "></span><p id=Out1 class=Outline style="cursor: hand; ">点击这里可以出现更多的链接<div id=Out1details style="display:None; position:relative; left:12;"><p style="line-height:150%"><a href="http://anyu.ent.topzj.com">暗域首页</a><br><a href="http://anyu.ent.topzj.com/index.php?gid=138940">暗域色彩</a><br><a href="http://anyu.ent.topzj.com/forumdisplay.php?fid=163137">暗域论坛建设</a><br><a href="http://anyu.ent.topzj.com/forumdisplay.php?fid=156940">暗域友情连接</a><br>----------<br><a href="http://anyu.ent.topzj.com/forumdisplay.php?fid=160656">暗域贴图</a><br><a href="http://anyu.ent.topzj.com/forumdisplay.php?fid=156394">暗域车</a></div></div>
<script language=JavaScript>function clickHandler(){var targetId,srcElement,targetElement;srcElement=window.event.srcElement;if(srcElement.className=="Outline"){targetId=srcElement.id+"details";targetElement=document.all(targetId);if(targetElement.style.display=="none"){targetElement.style.display="";}else{targetElement.style.display="none";}}};document.onclick = clickHandler;</script>
[ 本帖最后由 城市困兽 于 2006-11-2 03:19 编辑 ]
本帖最近评分记录
  • An_Apple 金币 +2 精品文章,以资鼓励 2006-11-2 04:27
  • An_Apple 宣传值 +2 精品文章,以资鼓励 2006-11-2 04:27

TOP

申精

TOP

之后将推出鼠标效果集合,今天太晚了。每个代码我都试过,一定可以用

TOP

<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">EASY LOVE BBS</span></div>
[url=http://lbbphoto.dd.topzj.com/forum-29064-1.html][/url]

TOP

不支持啊?郁闷类/...
[url=http://lbbphoto.dd.topzj.com/forum-29064-1.html][/url]

TOP

昨天写到3点半,竟然没几个人顶,气死了

TOP

这个也要顶下的

TOP

呵呵~!是不錯啊~!

TOP

怎麼用?比如,我想發帖子的時候出現彩色文字效果就是這個
8.彩色渐变文字


[Copy to clipboard]CODE:
<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("   江山如此多娇,引无数英雄竞折腰    ");}</script>

TOP

 21 123
发新话题