国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

DedeCMS列表頁隔行/多行隨意換色

2024-07-12 08:56:24
字體:
來源:轉載
供稿:網友

       在很多列表調用的時候都需要有隔行換色或者多行不同顏色,特別在全通式的首頁輪展圖的時候,要想實現輪展圖背景隨著圖片的更換,超過三張或多張的時候,隔行換色已經不能解決問題了,在原來的隔行換色的基礎上,進行小小的修改就可以實現這樣的功能。

列表調用隔行換色

輪展圖背景色換色

全通式首頁輪展圖背景色更換

照片墻網頁設計

照片墻形式

標簽說明:

arclist 標簽下使用 [field:global.autoindex/] 默認從1開始 channel 標簽下使用 [field:global.autoindex/] 默認從0開始 channelartlist 標簽下使用 {dede:global.itemindex/} 默認從1開始 arclist 從0開始[field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global] channel 從1開始[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/] channelartlist 從0開始{dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global} channelartlist 標簽下使用 {dede:global name='itemindex' runphp='yes'}@me;{/dede:global} 

隔行換色(增加樣式),list同arclist

<div> <ul>  {dede:list pagesize='50'}  <li>   [field:global runphp='yes' name=autoindex]   $a="<div id='a'>";   $b="<div id='b'>";   if ((@me%2)==0) @me=$a;   else @me=$b;   [/field:global]   <span class="date">[[field:typelink/]][field:pubdate function="MyDate('Y-m-d',@me)"/]</span>  <a href="[field:arcurl /]">[field:title /]</a> </li>  {/dede:list}</ul></div>

     如果運用channel弄隔行換色,需要自增從1開始,精簡寫法如下:
 

<div>  <ul>  {dede:channel row=6 typeid=''}  [field:global name=autoindex runphp="yes"]((@me+1) % 2 == 0)?@me="<li class=/"last/">":@me="<li>";[/field:global]   <h4 class="title">[field:title/]</h4>   </li>  {/dede:channel} </ul></div>

隔3行(n行)換色(增加樣式)精簡寫法,替換橙色字體部分

 <div>  <ul>  {dede:arclist row=6 typeid=''}  [field:global name=autoindex runphp="yes"](@me % 3 == 0)?@me="<li class=/"last/">":@me="<li>";[/field:global]   <h4 class="title">[field:title/]</h4>   </li>  {/dede:arclist} </ul></div>

多行隨意換色(增加樣式)

 

<div>    <ul>     {dede:arclist typeid='8' row='6' orderby='weight'}     [field:global runphp='yes' name=autoindex]      $a="<li class='gd1'>";      $b="<li class='gd2'>";      $c="<li class='gd3'>";      $d="<li class='gd4'>";      $e="<li class='gd5'>";      $f="<li class='gd6'>";      if ((@me/1)==1) @me=$a;     <!--調用的<li>次數(第一次調用)能被1整除,則該<li>對應$a的class='gd_1'-->      else if ((@me/2)==1) @me=$b;<!--調用的<li>次數(第二次調用)能被2整除,則該<li>對應$b的class='gd_2'-->      else if ((@me/3)==1) @me=$c;<!--調用的<li>次數(第三次調用)能被3整除,則該<li>對應$c的class='gd_3'-->      else if ((@me/4)==1) @me=$d;<!--調用的<li>次數(第四次調用)能被4整除,則該<li>對應$d的class='gd_4'-->      else if ((@me/5)==1) @me=$e;<!--調用的<li>次數(第五次調用)能被5整除,則該<li>對應$e的class='gd_5'-->      else if ((@me/6)==1) @me=$f;<!--調用的<li>次數(第六次調用)能被6整除,則該<li>對應$f的class='gd_6'-->     [/field:global]      <div class="gdbox">       <a href="[field:arcurl/]"><img src="[field:litpic/]" width="" height="" alt='[field:title function='html2text(@me)/][field:spacename/]' /></a>       <p><a href='[field:arcurl/]'>[field:title/]</a></p>      </div>     </li>     {/dede:arclist}    </ul></div>

精簡寫法
 

 <div>  <ul>  {dede:arclist row=6 typeid=''}   <li class=gd_[field:global.autoindex]>   <h4 class="title">[field:title/]</h4>   </li>  {/dede:arclist} </ul></div>

公共css樣式部分

      這里注意每張圖的在調用的時候width和height可以為空,如果是或者亂填都沒關系,靠樣式進行定義。
 

<style type="text/css">.gd1{width:750px;height:330px}.gd2{width:370px;height:165px}.gd3{width:185px;height:165px}.gd4{width:185px;height:165px}.gd5{width:335px;height:247px}.gd6{width:335px;height:247px}.gd1 img{width:750px;height:330px}.gd2 img{width:370px;height:165px}.gd3 img{width:185px;height:165px}.gd4 img{width:186px;height:165px}.gd5 img{width:335px;height:247px}.gd6 img{width:335px;height:247px}</style>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 华安县| 栾川县| 黄石市| 红原县| 彝良县| 湖口县| 汉川市| 筠连县| 达孜县| 郸城县| 宣恩县| 齐齐哈尔市| 错那县| 扎兰屯市| 永寿县| 浦县| 陆丰市| 肥东县| 玉山县| 特克斯县| 郧西县| 台东县| 新巴尔虎右旗| 吴忠市| 马鞍山市| 霍林郭勒市| 武义县| 霍州市| 化德县| 九寨沟县| 白沙| 都匀市| 临泽县| 淳安县| 花莲市| 瓮安县| 阿瓦提县| 阿合奇县| 扎囊县| 台安县| 两当县|