<div id="parent">
<div id="children">
</div>
</div>
And if we bind both parent and children with same events like :
$("#parent").live({ mouseenter : Infocus , mouseleave : Outfocus });
$("#children").live({ mouseenter : Infocus , mouseleave : Outfocus });
Now my problem is when i get my mouse over to the children the parent is also highlighted, Can anybody tell me whats going on here?
You’ve to use
stopPropagation()for prevent event follow.Read about .stopPropagation()
You can do something like this: (may be not satisfactory)
DEMO