我正在尝试设置切换按钮最近父级的高度:
CSS
.review-item {
background: #E8E8E2;
height: 26px;
margin-top: 15px;
overflow: hidden;
padding: 15px;
(等)
JS:
$(".submit-review-toggle").toggle(function(){
$(this).closest('.review-item').animate({height:168},200);
},function(){
$(this).closest('.review-item').animate({height:26},200);
});
HTML:
<div id="review-item-1" class="review-item">
<a href="#" class="submit-review-toggle review-item-toggle">+</a>
<h3>Service</h3>
<div class="review-overview">
<textarea name="message" placeholder="Overview" class="submit-review-overview">
</textarea>
</div>
<div class="review-photo">
<img src="images/no-photo.png" />
<div class="review-photo-upload">
<input type="file" class="file-upload" /><a href="#" class=
"facebook-import">Import pictures from Facebook</a>
</div><input type="text" placeholder="Caption" class="caption" />
</div>
</div>
出于某种原因,当我点击链接时没有任何反应。 有什么建议可以解决这个问题吗?