{dede:channelartlist} 改变偶数的class

{dede:channelartlist}
  <div 
    {dede:global.itemindex runphp='yes'}
      if((@me %2) == 0){
      @me = 'class="pfk_xm pfk_fr"';
      }
      else{
      @me = 'class="pfk_xm pfk_fl"';
      }
      {/dede:global.itemindex}
     >
    <div class="pfk_xm_tt">
      <h3><a href="{dede:field name='typeurl'/}" target="_blank">{dede:field name='typename'/}</a></h3>
      <p> <a href="" rel="nofollow" target="_blank">预约</a>| <a href="" rel="nofollow" target="_blank">预约</a> </p>
    </div>
    <div class="pfk_xm_cc">
      {dede:arclist row='1' infolen='100'}
        <h4><a href="[field:arcurl/]" title="[field:title/]">[field:title/]</a></h4>
        <div class="pfk_xm_cc_intro">
           <div><img src="[field:picname/]" alt="" width="98" height="69" /></div>
          <p>[field:info/]...<a href="[field:arcurl/]" title="[field:title/]">[详细]</a></p>
        </div>
      {/dede:arclist}
      <ul class="pfk_xm_cc_list">
        {dede:arclist row='4'}
              <li><a href="[field:arcurl/]" title="[field:title/]">[field:title/]</a></li>
        {/dede:arclist}
      </ul>
    </div>
  </div>
{/dede:channelartlist}

{dede:global.itemindex runphp='yes'} if((@me %2) == 0){ @me = 'class="pfk_xm pfk_fl"'; } else{ @me = 'class="pfk_xm pfk_fr"'; } {/dede:global.itemindex}

偶数第一个class 奇数用第二个class



posted @ 2020-01-06 14:36  冷晨  阅读(362)  评论(0编辑  收藏  举报