论坛和主题列表颜色深浅间隔的效果

上一篇 / 下一篇  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>&nbsp;</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:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 4779
  • 日志数: 10
  • 建立时间: 2007-03-14
  • 更新时间: 2007-09-07

RSS订阅

Open Toolbar