我有一系列图像:
1-3 是主要图像。3+ 是缩略图。
Q) 如何将拇指分成 2 行。
例如:
<div class="main-images">
{section name="i" loop=$images.rows}
{assign var="rows" value=$images.rows[i]}
{if $smarty.section.i.index <= 2}
<img />
{/if}
{/section}
</div>
<div class="thumbs-images">
{math assign=thumbs_count equation="total - other" total=$images.rowcount other=3}
{section name="i" loop=$images.rows}
{assign var="rows" value=$images.rows[i]}
{if $smarty.section.i.index >= 3}
<img />
{/if}
{/section}
</div>
所以我需要添加一些东西{if $thumbs_count >= $smarty.section.i.index}<div style="clear:both" />{/if}
,这样它就会出现在第二个循环的一半。