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

首頁 > CMS > 織夢DEDE > 正文

織夢dedecms列表頁隔行/多行隨意換色換樣式方法

2024-07-12 09:00:26
字體:
來源:轉載
供稿:網友

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

列表調用隔行換色

輪展圖背景色換色

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

照片墻網頁設計

照片墻形式

 

標簽說明:
1
2
3
4
5
6
7
8
9
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>[[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開始,精簡寫法如下:

1
2
3
4
5
6
7
8
9
<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>[field:title/]</h4>
   </li>
  {/dede:channel}
 </ul>
</div>

 

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

1
2
3
4
5
6
7
8
9
<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>[field:title/]</h4>
   </li>
  {/dede:arclist}
 </ul>
</div>

 

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<div>
    <ul>
     {dede:arclist typeid='8' row='6' orderby='weight'}
     [field:global runphp='yes' name=autoindex]
      $a="<li>";
      $b="<li>";
      $c="<li>";
      $d="<li>";
      $e="<li>";
      $f="<li>";
      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>
       <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>

 

精簡寫法

1
2
3
4
5
6
7
8
9
<div>
  <ul>
  {dede:arclist row=6 typeid=''}
   <li[field:global.autoindex]>
   <h4>[field:title/]</h4>
   </li>
  {/dede:arclist}
 </ul>
</div>

 

公共css樣式部分

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<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>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 股票| 清远市| 汝阳县| 韶山市| 灵川县| 泸水县| 寻乌县| 洛南县| 巴东县| 赞皇县| 道孚县| 阿尔山市| 大悟县| 平南县| 简阳市| 科技| 历史| 富蕴县| 张掖市| 龙游县| 西青区| 元氏县| 鸡西市| 澄江县| 怀来县| 根河市| 星子县| 沂源县| 金川县| 漳浦县| 永春县| 九江市| 科技| 麻栗坡县| 鄂州市| 肇源县| 齐河县| 广宁县| 绥中县| 汕头市| 斗六市|