我有一个foreach循环循环并显示数组中的所有数据没有问题,但我有一些jQuery我想应用到结果,但jQuery只适用于第一部分数据被显示。我不确定为什么,如果有人能够帮助那会很好。PHP与foreach问题与jQuery
$count_limit = 0;
$limit = 5;
foreach ($feeds->data as $item) {
extract((array) $item);
if($count_limit++ < $limit){
?>
<div id="news_post">
<? $title_str = str_replace('–', '–', $title) ?>
<p class="news_title"><a href="<?php echo $link; ?>" target="_blank"><?php echo $title_str; ?></a> <a href="#" class="read">read...</a></p>
<div class="news_desc"><?php echo "$description" ?></div>
</div>
<? }
else {
break;
}
$(this).next('.news_desc').hide();
$(this).next('a.read').click(function() {
$(this).next('.news_desc').toggle();
});
我们可以看到JQuery脚本吗? – 2011-03-25 01:27:42
' 2011-03-25 01:30:27