我遇到了问题:我想在悬停在h3元素上时强制对图像进行悬停功能。
html:
CSS:
查看我的代码片段: fiddle
html:
<p><a><img class="size-full wp-image-1236 alignleft" alt="phone-icon-red" src="..." width="50" height="50" /></a></p>
<h3>Contact Us</h3>
CSS:
img:hover{
margin-left: 10px;
}
js:
$('h3').hover(function(e){
e.preventDefault();
$(this).prev('p').find('img').trigger('mouseover');
});
查看我的代码片段: fiddle