Hover multiple elements affecting only 1 item
Posted
by
lilsizzo
on Stack Overflow
See other posts from Stack Overflow
or by lilsizzo
Published on 2012-07-04T03:13:41Z
Indexed on
2012/07/04
3:15 UTC
Read the original article
Hit count: 114
JavaScript
|jQuery
hi guys i was wondering if there is a way to hover a few elements with the same class name which is placed side by side and actions would be trigger upon leaving the area of the elements. For example :
<div class="hoverme"></div>
<div class="hoverme"></div>
<div class="hoverme"></div>
<div class="hoverme"></div>
<div class="hoverme"></div>
the javascript of "unhover" below should only be called when they leave the whole area of "hoverme" class.
$('.hoverme').live('mouseover mouseout', function(event) {
if (event.type == 'mouseover') {
if(!$("#stage1 td").hasClass("hover"))
{
$("#stage1 td").addClass("hover",200)
}
}
else {
//$("#stage1 td").removeClass("hover",200)
}
});
Is there a way for this action??
© Stack Overflow or respective owner