Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6343115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:22:25+00:00 2026-05-24T20:22:25+00:00

have a menu item which displays a modal div. wish the created div to

  • 0

have a menu item which displays a modal div. wish the created div to close automatically whenever the user moves his cursor out of it, but when the modal div is created originally the cursor is out of it, so the cursor first needs to move inside of it.

when I log to the console the onmouseout trigger being fired, where both e.target and e.currentTarget are the div itself, the event fires twice, first on entering the div and then on leaving the div.

first, this does not make sense to me – why is the happening? second, is there is a standard logic to use here?


all html is generated
here is some code which creates the modal and attached the mouseout trigger

// code creates the modal div from the menu
get:    function( e ) {
        util.popup( E.h4( "Maintenance Menu:" ),
           E.ul(  E.a( '#', maintenance.users, 'Users (Logins)' ),
                  E.a( '#', maintenance.employees, 'Employees' ),
                  E.a( '#', maintenance.skills, 'Skill Types' ),
                  E.a( '#', maintenance.etps, 'Expense Types' ),
                  E.a( '#', maintenance.menus, 'Menu Items' ) ),
            E.div(  E.button( maintenance.done, "s.width:90%", "Finished" ) ) );
         util.popup_dom().addEventListener( 'mouseout',util.popout() );
        },

popup() creates the modal and places it in BODY, popout() removes it.


solution (as per first answer – thanks!) using mouseover to set mouseout:

:
util.popup(...);
var outSet = false;  // whether mouseout trigger has been set
util.popup_dom().addEventListener( 'mouseover',function(e) {
   if( !outSet ) {
      setTimeout( function() { 
         util.popup_dom().addEventListener('mouseout',function(e){util.popout();} ),
         200 );
      outSet = true;
    }
} );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:22:27+00:00Added an answer on May 24, 2026 at 8:22 pm

    You could only register the onmouseout listener onmouseover:

    var closeModalDiv = function () { ... };
    
    addEventListener(modalDiv, 'mouseover', function () {
        addEventListener(modalDiv, 'mouseout', closeModalDiv);
    });
    

    (This assumes you’re using a custom, cross-browser event method named addEventListener; you’ll have to adjust this to however it is you’re registering events.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have dropdown menu..which is dynamic.. How can get value of the last item
I have a Menu page. If a user selects an Menu Item it opens
I have a simple unordered list with list items as menu item i created
I have some simple markup: <table> <tr> <td>Menu Item</td> </tr> </table> <div> <table> <tr>
I have created a status item (menu bar item) for my app, but at
I have a menu in which only one item has a sublist. Here is
I have created an HTML page which uses simple CSS (no javascript) for menu
I have a working webpage which just displays external html files inside a div
I have a top-level menu item which is responsible for refreshing a datagrid in
I have a menu(that comes when the user clicks default menu button) in which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.