论坛和主题列表颜色深浅间隔的效果
上一篇 /
下一篇 2007-04-10 00:34:02
/ 个人分类:discuz风格制作
主题列表就是模板forumdisplay.htm内的这个table,第一个<tr>是表头,第2个<tr>就是loop的内容。
|
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" class="row" nMouseOver="this.style.backgroundColor='{ALTBG1}'" nMouseOut="this.style.backgroundColor='{ALTBG2}'"> <!--{if $separatepos == $key + 1}--> <tr class="category"><td> </td><td colspan="6">{lang forum_normal_threads}</td></tr> <!--{/if}--> <tr> <!--就是这个tr -->
......
</tr></table> |
将这个<tr>替换成以下内容:
| <!--{if $key % 2 == 0}--><tr style="background: #xxx"><!--{else}--><tr style="background: #yyy"><!--{/if}--> |
其中$key是主题的序号,条件是如果$key能被2除尽(偶数),那么背景色使用#xxx,否则使用#yyy。(XXX和YYY请用颜色替换)
同样也可以应用于首页的论坛列表。修改discuz.htm内的下面内容
|
<!--{loop $cat[forums] $forumid}--> <!--{eval $forum=$forumlist[$forumid];}--> <tr class="row" nMouseOver="this.style.backgroundColor='{ALTBG1}'" nMouseOut="this.style.backgroundColor='{ALTBG2}'">
...... |
将这个<tr>修改成,当然mouseover的效果就不能加了。
|
<!--{if $forumid % 2 == 0}--><tr style="background: #xxx" class="row">
<!--{else}--><tr style="background: #yyy" class="row">
<!--{/if}--> |
效果图

导入论坛
收藏
分享给好友
管理
举报
TAG: