我有以下html:
<div id="join-us-subheader-imgs">
<div class="subheader-img-wrapper">
<img src="/wp-content/themes/lib/join_us/join-us_1.png">
<p class="img-quote">"This is a quote example. And there's more text here."</p>
</div>
<div class="subheader-img-wrapper">
<img src="/wp-content/themes/lib/join_us/join-us_2.png">
<p class="img-quote">"This is a quote example. And there's more text here."</p>
</div>
</div>
和CSS:
.subheader-img-wrapper {
float: left;
margin-right: 10px;
position: relative;
}
.subheader-img-wrapper img:hover{
cursor: pointer;
}
.img-quote {
display: none;
width: 125px;
height: 80px;
position: absolute;
top: 0;
}
aa和javascript:
$(document).ready(function() {
$(".subheader-img-wrapper").hover(
function(){
$(this).find('img:first').fadeOut("slow", function(){
$(this).parent().find('p:first').fadeIn("slow");
});
},
function(){
$(this).find('p:first').fadeOut("slow", function() {
$(this).parent().find('img:first').fadeIn("slow");
});
}
);
});
问题是,当我将鼠标悬停在第一个鼠标上时,它开始进出悬停功能,就像我一样