在jQuery中遍历时遇到问题..好似一个简单的问题..但我正在敲我的脑袋。我试过.closest()
,.next()
,.find()
..和缥缈jQuery遍历.next().show()
HTML:
<div class='news_box'>
<img src='".NEWS.$n[image]."' alt='$n[title] Image' class='news_img' />
<div class='news_text'>
<h3>$n[title] // ".date("d.m.Y", strtotime($n[created_on]))." // ".date("H.i", strtotime($n[created_on]))."</h3>
<p>".substr(strip_tags($n[description]), 0, 90)."... <span title='Read More On $n[title]' class='more'>Read More</span></p>
</div>
<p class='clear'></p>
<div class='full_item'>
$n[description]
</div>
</div><!--close news_box-->
的Jquery:
$(".news_box span.more").click(function(){
$(this).next(".full_item").show();
});
为.full_item
CSS设置为display:none
的目的是显示在div :full_item点击跨度.more
Thanks in adv暗疮!
'的console.log(这)'可以在看到比你期待什么 – Jack 2012-04-04 14:16:24