【发布时间】:2013-04-24 10:11:47
【问题描述】:
我想通过像这样悬停一个元素来触发另一个元素的悬停:
$(document).ready(function () {
$('.quarter h3').mouseenter(function () {
$(this).next().trigger('mouseenter');
});
});
HTML 是:
<div class="quarter grow">
<a href="#">
<h3><span>titel 1</span></h3>
<img src="http://lorempixel.com/200/230/people/1" alt="">
</a>
</div>
【问题讨论】:
-
据我所知,您不能使用 JavaScript 来触发 CSS
:hover伪类。我认为您需要使用 jQuery 在mouseenter/mouseleave上添加/删除一个类。
标签: jquery hover mouseenter