happy-yan 发表于 2006-7-24 12:22:27

[07/24][交流]两款文字特效

<font size=5 color=green>打字效果:</font><BR><BR>
<font size=3 color=purple>效果图:</font><BR><BR>
<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){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){if(navigator.plugins["LiveAudio"].type=="audio/basic" && navigator.javaEnabled()){document.embeds.stop();setTimeout("document.embeds.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, 'ttl0', 'ttl1', '#339933', '#99FF33', 50, 0);}</SCRIPT><SCRIPT>init()</SCRIPT><BR><BR>
<font size=3 color=red>代码:</font><BR>
<textarea rows=15 cols=140><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){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){if(navigator.plugins["LiveAudio"].type=="audio/basic" && navigator.javaEnabled()){document.embeds.stop();setTimeout("document.embeds.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, 'ttl0', 'ttl1', '#339933', '#99FF33', 50, 0);}</SCRIPT><SCRIPT>init()</SCRIPT></textarea><BR><BR><BR>

happy-yan 发表于 2006-7-24 12:31:22

<font size=5 color=green>文字逐个闪烁</font><BR><BR>
<font size=4 color=purple>效果图:</font>
<BR><BR>
<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>
<BR><BR>
<font size=4 color=purple>代码:</font>
<BR><BR>
<textarea rows=4 cols=140><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></textarea>

墓志铭 发表于 2006-7-24 19:08:18

<?import namespace = t urn = "urn:schemas-microsoft-com:time" implementation = "#default#time2" declareNamespace /><t:img id=go1 style="LEFT: 10px; CURSOR: hand; POSITION: absolute; TOP: 0px" src = "http://bbs.680.cn/UploadFile/2006-6/2006645102024221.gif"></t:img><t:animatemotion path = "m 0 0 c 271 -71 554 510 350 370 m 33 49 271 -171 54 310 50 30 m -133 -49 -71 -71 -54 -10 -50 -30 m 33 49 271 -271 54 310 150 130 m -33 -49 -271 -171 54 -310 -50 -30 m -233 -49 -171 -171 -54 -10 -50 -30 m 33 549 271 -171 54 310 50 30 m -133 -49 -71 -71 -54 -10 -50 -30 m 33 49 271 -271 54 310 150 130 m -33 -49 -271 -171 54 -310 -50 -30 m -233 -49 -171 -171 -54 -10 -50 -30" targetElement = "go1" accelerate = "1" autoReverse = "false" begin = "0" dur = "9" fill = "hold" repeatCount = "indefinite"></t:animatemotion>

墓志铭 发表于 2006-7-24 19:08:58

哈哈.我给作了个实验,楼主不要生气啊.

幽深森林 发表于 2006-8-17 13:14:59

挖..第一个代码真是长...<Br>
就试第二个吧<br>
<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>

[ 本帖最后由 happy-yan 于 2006-8-17 13:25 编辑 ]
页: [1]
查看完整版本: [07/24][交流]两款文字特效