Discuz教程网

[代码修改] Discuz X2利用群组建【分论坛】——【类似城市切换】功能

[复制链接]
authicon dly 发表于 2011-8-17 20:13:21 | 显示全部楼层 |阅读模式
104328280zn8iwnma8im1a.png


城市切换功能+群组=分论坛
演示站:邹平116生活网 www.zp116.com (小站求同类友情链接,快照正常收录稳定即可qq860526263)

X2.0版本的,打开:/template/default/common/header.htm (非默认风格,则修改风格中的header.htm)
搜索从下代码:
  1. <h2><!--{if !isset($_G['setting']['navlogos'][$mnid])}--><a href="./" title="$_G['setting']['bbname']">{$_G['style']['boardlogo']}</a><!--{else}-->$_G['setting']['navlogos'][$mnid]<!--{/if}--></h2>
复制代码
在下面添加代码
  1. <!--地区切换--><style type="text/css"> #city *{ margin:0;padding:0; z-index:1000000; top:0;left:0px; float:left;}#warpper{ position: relative; z-index:1000000; margin-top:20px;}#city { font:normal 12px Verdana, Arial, Helvetica, sans-serif; text-align:center; z-index:1000000;}#city a{ cursor:pointer; color:#666}#city dl{ height:18px; line-height:18px; padding:0 10px;}#city dt,.normal{ float:left; padding:0 10px 0 0 ; border-right:0px solid #ccc; text-decoration:none; width:auto; cursor:pointer; color:#FF3300; font-weight:bold;}#city dt.over{ position:relative;padding:0 10px 0px 0px; z-index:1000001;color:#FF3300; font-weight:bold; height:20px; }#city li{ float:left; list-style-type:none; margin:0px 5px; width:160px;}#city #c1 li a{ float:left; list-style-type:none; margin:0px 3px; 0 0 }#city dl dd{ position:absolute; width:160px; left:0;top:20px!important; border:1px solid #bbb; background:#fff; filter:progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=120, color=#cccccc); padding:3px 0;}.block{ display:block;}.none{ display:none;}</style><script language="javascript"> function $(str){ return document.getElementById(str);}function $(str){ return document.getElementsByTagName(str);}var timer;function changeMenu(thisObj,num){if(thisObj.className=="over") return false;hids(thisObj);thisObj.className="over";$("c"+(num+1)).className="block";
  2. $("c"+(num+1)).onmouseover=function(){clearTimeout(timer);}$("c"+(num+1)).onmouseout=function(){timer=setTimeout(function(){hids(thisObj);},500)}thisObj.onmouseout=function(){timer=setTimeout(function(){hids(thisObj);},3000)}
  3. }function hids(thisObj){clearTimeout(timer);var tabObj=thisObj.parentNode.getAttribute("id");var obj_dt=$(tabObj).getElementsByTagName("dt");for(var i=0;i<obj_dt.length;i++){obj_dt[i].className="normal";$("c"+(i+1)).className="none";}}</script><div id="city"><dl id="warpper"><dt onMouseOver="changeMenu(this,0);">[切换]</dt><dd id="c1" class="none"><ul><li><a href="http://www.zp116.com" target="_blank">魏桥</a> <a href="http://www.zp116.com" target="_blank">长山</a> <a href="http://www.zp116.com" target="_blank">青阳</a> <a href="http://www.zp116.com" target="_blank">好生</a> <a href="http://www.zp116.com" target="_blank">韩店</a> <a href="http://www.zp116.com" target="_blank">临池</a> <a href="http://www.zp116.com" target="_blank">孙镇</a> <a href="http://www.zp116.com" target="_blank">码头</a> <a href="http://www.zp116.com" target="_blank">台子</a> <a href="http://www.zp116.com" target="_blank">西董</a> <a href="http://www.zp116.com" target="_blank">九户</a> <a href="http://www.zp116.com" target="_blank">眀集</a> <a href="http://www.zp116.com" target="_blank">焦桥</a></li></ul></dd></dl>
  4. </div><!--地区切换_结束-->
复制代码



上一篇:2011中秋祝福
下一篇:Discuz X2 解决Thread List 首页N格 For Discuz X2.0 链接和用户id问题
authicon 家家 发表于 2011-11-5 11:28:06 | 显示全部楼层
好像不能用。
authicon  楼主| dly 发表于 2011-11-5 12:29:21 | 显示全部楼层
家家 发表于 2011-11-5 11:28
好像不能用。

原帖地址:http://www.discuz.net/thread-2330315-1-1.html
authicon 家家 发表于 2011-11-5 15:09:57 | 显示全部楼层
dly 发表于 2011-11-5 12:29
原帖地址:http://www.discuz.net/thread-2330315-1-1.html

原帖一样不能用。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-6-18 01:33

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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