I must to activate hover on an svg based element map.
So I got the map that can change color of a region hovering in selected region. Near this map I got a list of regions as link that must to highlight the relative region on the map hovering on that link.
Example Fiddle https://jsfiddle.net/fgsh896b/
I got something like this:
Example
function mouseEnt(id) {
$('#' + id).trigger('hover');
}
.item {
width:100px;
height: 100px;
border: 1px solid #000;
position: relative;
margin-left: 10px;
float: left;
}
.item:hover {
background-color: #000;
}
#link {
top: 150px;
position: absolute;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="1" class="item">
Item 1
</div>
<div id="2" class="item">
Item 2
</div>
<div id="link">
<a href="#" class="link" onMouseEnter="mouseEnt('1')">Link1</a>
<a href="#" class="link" onMouseEnter="mouseEnt('2')">Link2</a>
</div>
My function is wrong, I've tried with others jquery functions but maybe my logic is incorrect. how to reach this?