Discuz教程网

[代码修改] 顶部小导航制作 - 不修改文件(图文教程)

[复制链接]
authicon dly 发表于 2011-2-19 13:39:48 | 显示全部楼层 |阅读模式
截图03.jpg 截图04.jpg



贴上本站曾今用的代码:
代码一
  1. <!--Head横排 START-->
  2. <script type="text/javascript">
  3. function addFav(){   // 加入收藏夹
  4. if (document.all) {
  5.    window.external.addFavorite(window.location.href, document.title);
  6. } else if (window.sidebar) {
  7.    window.sidebar.addPanel(document.title, window.location.href, "");
  8. }
  9. }
  10. </script>
  11. <script type="text/javascript">
  12. function setHomepage(){   // 设为首页
  13. if (document.all)
  14.     {
  15.        document.body.style.behavior='url(#default#homepage)';
  16.        document.body.setHomePage('https://www.discuz.1314study.com');

  17.     }
  18.     else if (window.sidebar)
  19.     {
  20.     if(window.netscape)
  21.     {
  22.          try
  23.          {
  24.             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  25.          }
  26.          catch (e)
  27.          {
  28.             alert("该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
  29.          }
  30.     }
  31.     var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
  32.     prefs.setCharPref('browser.startup.homepage','https://www.discuz.1314study.com');
  33. }
  34. }
  35. </script>
  36. <SCRIPT language=JavaScript> <!--

  37. var week=new Array(7);

  38. week[0]="天";

  39. week[1]="一";

  40. week[2]="二";

  41. week[3]="三";

  42. week[4]="四";

  43. week[5]="五";

  44. week[6]="六";

  45. function settimes(){
  46. var today= new Date();
  47. var year=today.getFullYear();
  48. var month=today.getMonth()+1;
  49. var wk=today.getDay();
  50. var day=today.getDate();
  51. var hours= today.getHours();
  52. var mins= today.getMinutes();
  53. var secs= today.getSeconds();
  54. if(month<10)
  55. month="0"+month;
  56. if(day<10)
  57. day="0"+day;
  58. if (hours<10)
  59. hours="0"+hours;
  60. if(mins<10)
  61. mins="0"+mins;
  62. if (secs<10)
  63. secs="0"+secs;
  64. tim1.innerHTML = "今天是" +" "+ year + "年" + month + "月" + day + "日" +" "+ "星期" + week[wk] +" "+ "时间:" + hours+":"+mins+":"+secs;
  65. setTimeout('settimes()',960);
  66. }


  67. // --></SCRIPT>

  68. <center>
  69. <table cellspacing="0" cellpadding="0" border="0" align="center" width="950">

  70.                 <tbody>
  71.         <tr>

  72.                 <td width="5"><img height="27" width="5" src="https://www.discuz.1314study.com/images/other/head_bg_01.jpg"></td>

  73.                 <td background="https://www.discuz.1314study.com/images/other/head_bg_02.jpg" width="771">
  74.         <table cellspacing="0" cellpadding="0" border="0" width="960" style="font-size: 12px;">


  75. <tbody>
  76.         <tr>
  77. <td id=tim1></td>
  78. <td width="460"><a href="https://www.discuz.1314study.com"><font color=blue>1314学习网 </font></a>(<a href="https://www.discuz.1314study.com"><font style="color: #000; font-weight:bold;">www.discuz.1314study.com</font></a>)<a href="https://www.discuz.1314study.com">提醒您:
  79.         <! --倒计时开始-->
  80.                 <script language="JavaScript">
  81.                 var urodz= new Date("2/2/2011");
  82.                 var s="距<font color="red"> 除夕 </font>";
  83.                 var now = new Date();
  84.                 var ile = urodz.getTime() - now.getTime();
  85.                 var dni = Math.floor(ile / (1000 * 60 * 60 * 24));
  86.                 if (dni > 1)
  87.                 document.write(""+s+"还有"+dni +"天")
  88.                 else if (dni == 1)
  89.                 document.write("只有2天啦!")
  90.                 else if (dni == 0)
  91.                 document.write("只有1天啦!")
  92.                 else
  93.                 document.write("好象已经过了哦!");
  94.                 </script>
  95.         <! --end time-->
  96. </a>
  97. </td>
  98. <td width="32"></td>

  99. <td width=62><A href="https://www.discuz.1314study.com/Shortcut.php" target=_blank>桌面捷径</A></td>

  100. <td width="62"><a href ="javascript:addFav(0)">添加收藏</a></td>

  101. <td width="62"><a href ="javascript:setHomepage(0)">设为首页</a></td>

  102.         </tr>


  103. </tbody>
  104.         </table>
  105.                 </td>
  106. <td width="5"><img height="27" width="5" alt="" src="https://www.discuz.1314study.com/images/other/head_bg_03.jpg"></td>
  107.         </tr>

  108.                 </tbody>
  109. </table>
  110. </center>
  111. <SCRIPT language=JavaScript>
  112. setTimeout('settimes()',10);
  113. </SCRIPT>
复制代码

代码二
  1. <!--Head横排 START-->
  2. <script type="text/javascript">
  3. function addFav(){   // 加入收藏夹
  4. if (document.all) {
  5.    window.external.addFavorite(window.location.href, document.title);
  6. } else if (window.sidebar) {
  7.    window.sidebar.addPanel(document.title, window.location.href, "");
  8. }
  9. }
  10. </script>
  11. <script type="text/javascript">
  12. function setHomepage(){   // 设为首页
  13. if (document.all)
  14.     {
  15.        document.body.style.behavior='url(#default#homepage)';
  16.        document.body.setHomePage('https://www.discuz.1314study.com');

  17.     }
  18.     else if (window.sidebar)
  19.     {
  20.     if(window.netscape)
  21.     {
  22.          try
  23.          {
  24.             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  25.          }
  26.          catch (e)
  27.          {
  28.             alert("该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
  29.          }
  30.     }
  31.     var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
  32.     prefs.setCharPref('browser.startup.homepage','https://www.discuz.1314study.com');
  33. }
  34. }
  35. </script>


  36. <center>
  37. <table cellspacing="0" cellpadding="0" border="0" align="center" width="950">

  38.                 <tbody>
  39.         <tr>

  40.                 <td width="5"><img height="27" width="5" src="https://www.discuz.1314study.com/images/other/head_bg_01.jpg"></td>

  41.                 <td background="https://www.discuz.1314study.com/images/other/head_bg_02.jpg" width="771">
  42.         <table cellspacing="0" cellpadding="0" border="0" width="960" style="font-size: 12px;">


  43. <tbody>
  44.         <tr>
  45. <TD>
  46. <SCRIPT language=JavaScript> <!--

  47. var week=new Array(7);

  48. week[0]="天";

  49. week[1]="一";

  50. week[2]="二";

  51. week[3]="三";

  52. week[4]="四";

  53. week[5]="五";

  54. week[6]="六";

  55. function settimes(){
  56. var today= new Date();
  57. var year=today.getFullYear();
  58. var month=today.getMonth()+1;
  59. var wk=today.getDay();
  60. var day=today.getDate();
  61. var hours= today.getHours();
  62. var mins= today.getMinutes();
  63. var secs= today.getSeconds();
  64. if(month<10)
  65. month="0"+month;
  66. if(day<10)
  67. day="0"+day;
  68. if (hours<10)
  69. hours="0"+hours;
  70. if(mins<10)
  71. mins="0"+mins;
  72. if (secs<10)
  73. secs="0"+secs;
  74. tim1.innerHTML = "今天是" +" "+ year + "年" + month + "月" + day + "日" +" "+ "星期" + week[wk] +" "+ "时间:" + hours+":"+mins+":"+secs;
  75. setTimeout('settimes()',960);
  76. }


  77. // --></SCRIPT>
  78. </TD>

  79. <td class=time id=tim1></td>
  80. <td width="530"><a href="https://www.discuz.1314study.com"><font color=blue>1314学习网 </font></a>(<a href="https://www.discuz.1314study.com"><font style="color: #000; font-weight:bold;">www.discuz.1314study.com</font></a>)<a href="https://www.discuz.1314study.com">已正式安全运行
  81.         <font color="red">
  82.         <script language=JavaScript>
  83.                 var urodz= new Date("8/8/2010");
  84.                 var now = new Date();
  85.                 var ile = now.getTime() - urodz.getTime();
  86.                 var dni = Math.floor(ile / (1000 * 60 * 60 * 24));
  87.                 document.write(+dni)
  88.         </script></font> 天</a> <a href="https://www.discuz.1314study.com">感谢您对我们的支持!</a></td>

  89. <td width="2"></td>

  90. <td width="52"><a href="https://www.discuz.1314study.com/Shortcut.php" target=_blank>桌面捷径</a></td>

  91. <td width="52"><a href ="javascript:addFav(0)">添加收藏</a></td>

  92. <td width="52"><a href ="javascript:setHomepage(0)">设为首页</a></td>

  93.         </tr>


  94. </tbody>
  95.         </table>
  96.                 </td>
  97. <td width="5"><img height="27" width="5" alt="" src="https://www.discuz.1314study.com/images/other/head_bg_03.jpg"></td>
  98.         </tr>

  99.                 </tbody>
  100. </table>
  101. </center>
  102. <SCRIPT language=JavaScript>
  103. setTimeout('settimes()',10);
  104. </SCRIPT>
复制代码


代码三(存在问题,需自行修改,图片貌似找不到了)

  1. <STYLE>BODY {
  2.         FONT-SIZE: 12px; BACKGROUND: url(https://www.discuz.1314study.com/dingbu/dingbu/bg.gif) repeat-x; MARGIN: 0px; COLOR: #333; TEXT-ALIGN: center
  3. }
  4. A {
  5.         COLOR: #333; FONT-FAMILY: Arial; TEXT-DECORATION: none
  6. }
  7. A:hover {
  8.         COLOR: #f00; TEXT-DECORATION: none
  9. }
  10. IMG {
  11.         BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px
  12. }
  13. .all {
  14.         MARGIN: 0px auto; OVERFLOW: hidden; WIDTH: 970px; HEIGHT: 39px; TEXT-ALIGN: left
  15. }
  16. .logo {
  17.         FLOAT: left; OVERFLOW: hidden; HEIGHT: 36px
  18. }
  19. .menu {
  20.         FLOAT: left; MARGIN: 12px 0px 0px 10px; OVERFLOW: hidden; LINE-HEIGHT: 8px
  21. }
  22. .game {
  23.         FLOAT: right; MARGIN: 12px 0px 0px 15px; OVERFLOW: hidden; LINE-HEIGHT: 8px
  24. }
  25. .other {
  26.         BACKGROUND: url(https://www.discuz.1314study.com/dingbu/dingbu/gudong.gif) no-repeat; FLOAT: right; MARGIN: 10px 0px 0px; OVERFLOW: hidden; WIDTH: 225px; HEIGHT: 18px
  27. }
  28. #gundongnews0 {
  29.         PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none
  30. }
  31. #gundongnews0 LI {
  32.         PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none
  33. }
  34. #gundongnews0 {
  35.         PADDING-RIGHT: 0px; PADDING-LEFT: 45px; PADDING-BOTTOM: 0px; OVERFLOW: hidden; PADDING-TOP: 0px; HEIGHT: 18px
  36. }
  37. #gundongnews0 LI {
  38.         PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; OVERFLOW: hidden; LINE-HEIGHT: 15px; PADDING-TOP: 3px
  39. }
  40. </STYLE>
  41. <DIV class=all>
  42. <DIV class=game><IMG src="https://www.discuz.1314study.com/dingbu/dingbu/ico01.gif" width=11><A
  43. href="https://www.discuz.1314study.com/search.php?mod=forum&adv=yes" target=_blank><FONT
  44. color=#ff0000>站内高级查询</FONT></A> <IMG src="https://www.discuz.1314study.com/dingbu/dingbu/ico02.gif" width=11> <A
  45. href="https://www.discuz.1314study.com/" target=_blank>管理团队</A> </DIV>

  46. <div class=other><ul id=gundongnews0><li><a href="https://www.discuz.1314study.com/forum-viewthread-tid-11199-fromuid-1.html
  47. " target="_blank">体验手机上论坛的乐趣</a></li><li><a href="https://www.discuz.1314study.com/thread-10391-1-1.html" target="_blank">1314学习网管理规定(试行)</a></li><li><a href="https://www.discuz.1314study.com/thread-10613-1-1.html" target="_blank">本站域名公告</a></li><li><a href="https://www.discuz.1314study.com/thread-6995-1-1.html" target="_blank">【论坛帖图新手必看】</a></li><li><a href="https://www.discuz.1314study.com/thread-10614-1-1.html" target="_blank">发帖标题、内容注意事项</a></li><li><a href="https://www.discuz.1314study.com/thread-32-1-1.html" target="_blank">帖子精华、推荐、置顶等标准</a></li><li><a href="https://www.discuz.1314study.com/thread-27-1-1.html" target="_blank">论坛现招版主</a></li></ul></div>

  48. <SCRIPT>
  49.         <!-- //新闻滚动JS代码
  50.         function startmarquee(lh,speed,delay,index){
  51.                 var t;
  52.                 var p=false;
  53.                 var o=document.getElementById("gundongnews"+index);
  54.                 o.innerHTML+=o.innerHTML;
  55.                 o.onmouseover=function(){p=true}
  56.                 o.onmouseout=function(){p=false}
  57.                 o.scrollTop = 0;
  58.                 function start(){
  59.                         t=setInterval(scrolling,speed);
  60.                         if(!p) o.scrollTop += 2;
  61.                 }
  62.                 function scrolling(){
  63.                         if(o.scrollTop%lh!=0){
  64.                                 o.scrollTop += 2;
  65.                                 if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;
  66.                         }
  67.                         else{
  68.                         clearInterval(t);
  69.                         setTimeout(start,delay);
  70.                         }
  71.                 }
  72.                 setTimeout(start,delay);
  73.         }
  74.         startmarquee(18,80,3000,0); /*(一次滚动高度,速度,停留时间,图层标记)*/
  75.         //-->
  76.         </SCRIPT>

  77. <DIV class=logo>  </A></DIV>
  78. <DIV class=menu><IMG src="https://www.discuz.1314study.com/dingbu/dingbu/ico01.gif" width=11> <A
  79. href="javascript:window.external.AddFavorite('https://www.discuz.1314study.com/',%20'1314学习网)"><FONT
  80. color=#ff0000>点击加入收藏夹</FONT></A> | <A
  81. href="http://so.3qq.cc/" target=_top>1314搜索</A> | <IMG
  82. src="https://www.discuz.1314study.com/dingbu/dingbu/msnminiico.gif" width=15><A
  83. href="https://www.discuz.1314study.com/news/" target=_top>1314资讯</A> | <IMG
  84. src="https://www.discuz.1314study.com/dingbu/dingbu/tvminiico.gif" width=16><A href="https://www.discuz.1314study.com/news/sgsp/"
  85. target=_top>上高视频</A> | <A
  86. href="http://blog.3qq.cc/" target=_top>找朋友</A>
  87. </DIV></DIV>
复制代码






上一篇:【Discuz X1.5】QQ群展示需要的就下载,群展示作者升级为4.0版
下一篇:手工diy的清爽门户新闻频道模板
authicon mikejiang 发表于 2011-3-5 17:41:18 | 显示全部楼层
这个帖子不回对不起自己!我想我是一天也不能离开1314学习网
authicon 82xiaochong911 发表于 2011-5-8 05:59:56 | 显示全部楼层
强人,佩服死了。
authicon lilac_yao 发表于 2011-5-10 13:59:41 | 显示全部楼层
好耶!功能强大啊
authicon 婷婷爱牛牛 发表于 2011-5-10 17:59:51 | 显示全部楼层
好东西,要下来看看
authicon huanglv80 发表于 2011-5-11 05:59:39 | 显示全部楼层
我回不回呢 考虑再三 还是不回了吧 ^_^
authicon forever21 发表于 2011-5-13 10:59:46 | 显示全部楼层
好像不错的样子
authicon Cute宝贝儿 发表于 2011-5-14 19:59:34 | 显示全部楼层
看一下啊,嘻嘻
authicon 暗夜的烟火 发表于 2011-5-25 23:00:01 | 显示全部楼层
喜欢喜欢喜欢
authicon yuki佳 发表于 2011-6-18 19:00:16 | 显示全部楼层
偶的天啊!爱死你了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-5-16 22:28

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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