Search code examples
jqueryhovermouseenter

By hover, trigger another element's hover


I want to trigger another element's hover by hovering an element like so:

$(document).ready(function () {
    $('.quarter h3').mouseenter(function () {
        $(this).next().trigger('mouseenter');
    });
});

HTML is:

<div class="quarter grow">
    <a href="#">
        <h3><span>titel 1</span></h3>
    <img src="http://lorempixel.com/200/230/people/1" alt="">
    </a>
</div>

Take a look at the fiddle: http://jsfiddle.net/KkYGC/


Solution

  • if i understood your problem correctly you could just change

    .grow img:hover {
    

    to

    .grow:hover img {