试图移动使用悬停一些div一类,这是我的标记:找到属于母公司jQuery中
<div class="item dark-grey">
<div class="img">
<img src="images/case-study-develop.jpg" width="174" height="59" alt="Case Study">
</div>
<div class="triangle-container">
<div class="triangle-border-light-blue"></div>
<div class="triangle-dark-grey"></div>
</div>
<div class="content light-blue">
<h2><a href="#">Developing community work with the voluntary sector</a></h2>
</div>
</div>
这是我在用的那一刻,它工作正常,但我只想要悬停在内容div上,而不是整个项目div。
$(document).ready(function() {
$('.item').hover(function(e){
$('.img', this).animate({height: "30px"},100);
},function(e){
$('.img', this).animate({height: "58px"},100);
});
});
我想如果我将鼠标悬停在.item。内容,然后让家长,并找到.IMG归属于母公司它的工作,但我不知道如果我这样做是正确的。
$('.item .content').hover(function(e){
$(this).parents('.img').animate({height: "30px"},100);
}
Downvote似乎苛刻。 – 2012-04-03 14:35:03