Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[修改] html代码展示打字效果,怎么应用到论坛?

[复制链接]
神龙117 发表于 2014-7-12 21:58:25 | 显示全部楼层 |阅读模式
想把打字效果应用到论坛首页的一些可以diy的位置。
代码找到了,但是在diy时候,选择自由代码 展示的时候整个页面字体都变大了,是不是需要调用?
把代码上来,希望有人能分析以后 给大家分享!!!!
  1. <html>
  2. <head>
  3. <title>打字效果的带链接的新闻标题</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <style type="text/css">
  6. body{font-size:14px;font-weight:bold;}
  7. </style>
  8. </head>
  9. <body>
  10. 最新内容:<a id="HotNews" href="" target="_blank"></a>
  11. <SCRIPT LANGUAGE="JavaScript">
  12. <!--
  13. var NewsTime = 2000;        //每条新闻的停留时间
  14. var TextTime = 50;                //新闻标题文字出现等待时间,越小越快

  15. var newsi = 0;
  16. var txti = 0;
  17. var txttimer;
  18. var newstimer;

  19. var newstitle = new Array();        //新闻标题
  20. var newshref = new Array();                //新闻链接

  21. newstitle[0] = "懒人图库";
  22. newshref[0] = "http://www.lanrentuku.com/";

  23. newstitle[1] = "http://www.lanrentuku.com/";
  24. newshref[1] = "http://www.lanrentuku.com/";

  25. newstitle[2] = "显而易见,最高的效率就是对现有材料的最佳利用。";
  26. newshref[2] = "http://www.lanrentuku.com/";

  27. newstitle[3] = "学会偷懒,并懒出境界是提高工作效率最有效的方法!";
  28. newshref[3] = "http://www.lanrentuku.com/";

  29. newstitle[4] = "bye";
  30. newshref[4] = "http://www.lanrentuku.com/";

  31. function shownew()
  32. {
  33.         //code by haiwa @2005-10-21 www.51windows.net
  34.         var endstr = "_"
  35.         hwnewstr = newstitle[newsi];
  36.         newslink = newshref[newsi];
  37.         if(txti==(hwnewstr.length-1)){endstr="";}
  38.         if(txti>=hwnewstr.length){
  39.                 clearInterval(txttimer);
  40.                 clearInterval(newstimer);
  41.                 newsi++;
  42.                 if(newsi>=newstitle.length){
  43.                         newsi = 0
  44.                 }
  45.                 newstimer = setInterval("shownew()",NewsTime);
  46.                 txti = 0;
  47.                 return;
  48.         }
  49.         clearInterval(txttimer);
  50.         document.getElementById("HotNews").href=newslink;
  51.         document.getElementById("HotNews").innerHTML = hwnewstr.substring(0,txti+1)+endstr;
  52.         txti++;
  53.         txttimer = setInterval("shownew()",TextTime);
  54. }
  55. shownew();
  56. //-->
  57. </SCRIPT>
  58. <p><a  target="_blank">懒人图库</a></p>
  59. </body>
  60. </html>
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-9 23:25 , Processed in 0.104970 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表