
内容模板用php分割$navinfor[字段名]内容,例子:
<?php
$morefr=explode(‘||||||’,$navinfor[字段名]);
$mfcount=count($morefr);
for($mfi=0;$mfi<$mfcount;$mfi++)
{
?>
<?=$morefr[$mfi]?>
<?php
}
?>
多值字段的循环 显示图片
<?php
$morefr=explode(‘||||||’,$navinfor[duopic]);
$mfcount=count($morefr);
for($mfi=0;$mfi<$mfcount;$mfi++)
{
?>
<li onMouseOver=’cthis(<?=$mfi?> , 7)’ class=’this’ id=’simg_<?=$mfi?>’>
<a href=’/e/ViewImg/index.html?url=<?=$morefr[$mfi]?>’ title=’点击查看大图’ target=’_blank’><img src='<?=$morefr[$mfi]?>’ width=’50’ height=’50’ align=’absmiddle’ onMouseMove=’document.getElementByIdx_x_x_x(‘showmainimg’).src='<?=$morefr[$mfi]?>’;document.getElementByIdx_x_x_x(‘showmainimgvalue’).value='<?=$morefr[$mfi]?>’;document.getElementByIdx_x_x_x(‘BigViewImage’).setAttribute(‘href’,'<?=$morefr[$mfi]?>’)’ alt='[!–title–]’/></a>
</li>
<?php
}
?>
以上代码中
其中<li onMouseOver=’cthis(<?=$mfi?>, 7)’ class=’this’ id=’simg_<?=$mfi?>’>
<?=$mfi?> 我想从0开始递加 alt里用模板变量[!–title–]可以正常显示标题
人吐槽 | 人点赞 |
发表评论