I have created a dropdown menu. This menu opens by pointing on a parent div. I want to hide this div when user leaves both, the parent div or dropdown menu
$(function(){
$('.a').live('mouseenter',function(){
$('#dropdown').stop(false, true).hide();
var id = $(this).attr('id');
$('#dropdown').css({
position:'absolute',
top: $(this).offset().top + $(this).height() + 'px',
right: '115px',
left: $(this).offset().left + 'px',
zIndex:1000,
width:'100px'
});
$('#dropdown').stop().slideDown(500);
if($('#dropdown').mouseleave() && $('#'+id).mouseleave()){
$('#dropdown').slideUp(500);
}
});
});
you have to add mouseleave event and check the dropdown, to keep it short, try this
i hope this is what you wanted