我有一个重复的区域问题。我在这里尝试做的是重复查询中的信息,直到用完为止。我将它的限制设置为 5。我希望信息重复,但 DIV id 在重复时会发生变化。这是可能吗?我在这里尝试创建的是一个特色的 jquery 滑块,为此我需要显示的内容以在主框中滑动或单击时将其拉入主框。提前致谢。
<?php
$idname = "fragment-";
$idnum = 1;
echo $idname . $idnum;
?>
<?php do { ?>
<div id="<?php for($idnum=1;$idnum<=5;$idnum++){
echo $idname . $idnum++; break;}?>" class="ui-tabs-panel" style="">
<img src="<?php echo $row_getDisplay['picture']; ?>" alt="" />
<div class="info" >
<h2><a href="fetch?id=<?php echo $row_getDisplay['post_id']; ?>" ><?php echo $row_getDisplay['title']; ?></a></h2>
<p><?php echo $row_getDisplay['preview']; ?><a href="fetch?id=<?php echo $row_getDisplay['post_id']; ?>" >Click Here</a></p> </div>
</div>
<?php } while ($row_getDisplay = mysql_fetch_assoc($getDisplay)); ?>
这是代码的当前输出..
<div id="fragment-1" class="ui-tabs-panel" style="">
<img src="images/archives/2012/july/1343579505.jpg" alt="" />
<div class="info" >
<h2><a href="fetch?id=39" >Testing Preview Box Character Count max out on the total number</a></h2>
<p>Other things have to go here to show the preview seems like other things don't really fit<a href="fetch?id=39" >Click Here</a></p> </div>
</div>