1. <script Language="JavaScript">
  2. <!--
  3. if(navigator.appVersion.charAt(0)>=4 && (navigator.appVersion).indexOf("MSIE")!=-1) isIE4 = true;
  4. else isIE4 = false;
  5. function textAnima_color2(id,n) {
  6. el = document.all.item(id,n);
  7. charColor = el.getAttribute("SET_COLOR");
  8. cur = el.getAttribute("CURRENT_CHAR");
  9. if(cur=="") cur = 0;
  10.  
  11. getHTML= el.getAttribute("SET_TEXT");
  12. if(getHTML == "") {
  13. getHTML = el.innerText;
  14. el.setAttribute("SET_TEXT",getHTML);
  15. }
  16.  
  17. bef_t = getHTML.substring(0,cur); ;
  18. aft_t = getHTML.substring(eval(cur)+1,getHTML.length);
  19. cur_t = getHTML.substr(cur,1);
  20. cur_t = cur_t.fontcolor(charColor);
  21. el.innerHTML = bef_t + cur_t + aft_t;
  22.  
  23. cur++;
  24. if(cur > getHTML.length) cur=0;
  25. el.setAttribute("CURRENT_CHAR",cur);
  26. getT = el.getAttribute("SET_TIME");
  27. if(getT=="") getT = 100;
  28. setTimeout("textAnima_color2('"+id+"',"+n+")",eval(getT));
  29. }
  30.  
  31. if(isIE4) {
  32. window.onload = init;
  33. }
  34.  
  35.  
  36. function init() {
  37. id = "ANIMA_TEXT_COLOR2";
  38. len = document.all.item(id).length;
  39. if(!len) len=1;
  40. for(var i=0;i<len;i++) {
  41. textAnima_color2(id,i);
  42. }
  43. }
  44. //-->
  45. </script>
  46. <b><span style="font-size:14pt;color=red;font-family:新細明體";
  47. id="ANIMA_TEXT_COLOR2" SET_COLOR="yellow"
  48. SET_TIME="100" CURRENT_CHAR SET_TEXT>JAVASCRIPT閃爍文字效果!!!</span>


无觅相关文章插件,快速提升流量