I am trying to verify if a html element is not being hoverover (i mean when mouse leaves that div) in order to hide another element. The problem is that the element i need to check the status is generated dynamically for another third party library and it can be duplicated. The html looks like this: Just one of them is visible at a time
<div class="jqx-menu-popup jqx-menu-popup" style="visibility: hidden;">
....
</div>
<div class="jqx-menu-popup jqx-menu-popup" style="visibility: visible;">
....
</div>
So i was trying to do something like this:
if (!$('.jqx-menu-popup').is(':hover'))
{
$('#' + 'jqxmenu' + elementHover).jqxMenu('close');
}
but because there are multiple instances of the div the is(':hover') trigger an exception .
So i thought about something like this to try to get the div which is visible then verify if it is being hoverover:
var a = $('.jqx-menu-popup:visible')
if (!a.is(':hover')) {
$('#' + 'jqxmenu' + elementHover).jqxMenu('close');
}
but base on jquery documentation "Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout"
Any ideas how can i achieve what i want?