Discuz教程网

[代码修改] Discuz X2 仿DSU顶部悬浮导航

  [复制链接]
authicon dly 发表于 2011-6-2 15:25:45 | 显示全部楼层 |阅读模式
以下是要删除的代码:
  1. <div id="toptb" class="cl">
  2. <div class="wp">
  3. <div class="z">
  4. <!--{loop $_G['setting']['topnavs'][0] $nav}-->
  5. <!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->
  6. $nav[code]
  7. <!--{/if}-->
  8. <!--{/loop}-->
  9. <!--{hook/global_cpnav_extra1}-->
  10. </div>
  11. <div class="y">
  12. <!--{hook/global_cpnav_extra2}-->
  13. <!--{loop $_G['setting']['topnavs'][1] $nav}-->
  14. <!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->
  15. $nav[code]
  16. <!--{/if}-->
  17. <!--{/loop}-->
  18. <!--{if $_G['basescript'] == 'forum' && empty($_G['disabledwidthauto']) && $_G['setting']['switchwidthauto']}-->
  19. <a href="javascript:;" onClick="widthauto(this)">
  20. <!--{if !$_G['forum_widthauto']}-->
  21. {lang switch_wide}
  22. <!--{else}-->
  23. {lang switch_narrow}
  24. <!--{/if}-->
  25. </a>
  26. <!--{/if}-->
  27. <!--{if $_G['uid'] && !empty($_G['style']['extstyle'])}-->
  28. <a id="sslct" href="javascript:;" onMouseOver="delayShow(this, function() {showMenu({'ctrlid':'sslct','pos':'34!'})});">{lang changestyle}</a>
  29. <!--{/if}-->
  30. <!--{if CURMODULE != 'topic' && $_G['group']['allowdiy'] && !empty($_G['style']['tplfile']) || CURMODULE == 'topic' && !empty($_G['style']['tplfile']) && ($_G['group']['allowaddtopic'] && $topic['uid'] == $_G['uid'] || $_G['group']['allowmanagetopic'])}-->
  31. <a id="diy-tg" href="javascript:openDiy();" title="{lang open_diy}" class="xi1 xw1">DIY</a>
  32. <!--{/if}-->
  33. </div>
  34. </div>
  35. </div>
复制代码
haed间的JS代码:
  1. <script language="javascript">
  2. function codefans(){
  3. var box=document.getElementById("top123");
  4. box.style.display="none";
  5. }
  6. setTimeout("codefans()",9000);//这里可设置关闭时间
  7. </script>
复制代码
CSS文件:
  1. #topbar{ line-height: 18px;position:fixed;top:0;background:#FAF5F5;border-bottom:1px solid #CDCDCD;padding:5px 15px; margin-bottom:15px;height:18px;font-size:12px;width:100%;z-index:80;}
  2. #top123{position: absolute; top:25px; right:50px;_right:23px;}
  3. .wp_top{ width:95%; margin:0 auto;}
  4. .wp_top .z a{ padding-right:6px;}
  5. .top1{padding: 10px; width:150px; border: 1px solid #B1B1B1; background: #FEFEE9;}
  6. .top2 .tip_horn { right: 55px; top: -6px; background: url({IMGDIR}/tip_top.png); }
  7. .top2{ margin-top: 8px; }
复制代码

使用说明:
1、下载附件解压,将space_header.html上传至模板文件夹home下
2、打开header.html将以上的代码删除
3、将解压的文件顶部导航源代码.txt里面的代码插入到<!--{if !IS_ROBOT}-->上面
4、把JS代码放入haed之间,
5、将CSS文件放入common.css里面!最好是放#hd{}上面
6、更新缓存即可
演示网站:www.nc848.com
支持网站:www.caogenb.com

附件下载:
游客,如果您要查看本帖隐藏内容请回复





上一篇:Discuz X1.5/2 自动获得邀请码(防注册机) V2.01
下一篇:求本站的SITEMAP.PHP网站地图插件
authicon 让测试飞起来 发表于 2011-6-2 16:27:31 | 显示全部楼层
看一下,好像没印象
authicon 主编 发表于 2011-6-2 18:55:14 | 显示全部楼层
支持支持~~~~~~~~
authicon 欣雨她爸 发表于 2011-6-2 19:51:23 | 显示全部楼层
看一下,好像没印象
authicon 1617602781 发表于 2011-6-3 14:41:35 | 显示全部楼层
authicon 1617602781 发表于 2011-6-3 14:42:00 | 显示全部楼层
authicon tm001 发表于 2011-6-3 18:05:33 | 显示全部楼层
我也写过一个,不知道一样不?
authicon wuwanbin 发表于 2011-6-3 23:02:29 | 显示全部楼层
呵呵,支持一下,顶起
authicon toycaners 发表于 2011-6-8 22:10:21 | 显示全部楼层
这个真的很好用!!!~
authicon forever21 发表于 2011-6-17 10:59:48 | 显示全部楼层
谢谢,学习了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-3 13:14

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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