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

  • SEARCH
  • Home
  • 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 8132921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:27:46+00:00 2026-06-06T09:27:46+00:00

I have several onmouseover events (combination of javascript functions and jquery accordions) but they

  • 0

I have several onmouseover events (combination of javascript functions and jquery accordions) but they seem to be overly sensitive to the exact location of the mouse to the point that it’s making it either very difficult to trigger and/or overly easy to mouseout and close the function (making it very difficult to select something and/or to inadvertently trigger the wrong function). I’m working with a very tight layout so I can’t increase the space between elements.

What’s a simple way to either expand the area that will trigger a function or decrease the sensitivity surrounding a mouseover element without affecting the layout? I’ve tried playing with the margins and padding and it hasn’t seemed to help.

I’ve included below one example of this in a javascript function that I’m using in the menu.

# HTML #
<a style="top:13px; left:43px; position:absolute; z-index:31" href="createaccount.html">Create Account </a>

<ul class="menu" style="top:2px; left:99px; position:absolute;"> 
<li><a style=" text-align: left;" href="createaccount.html" onmouseover="mopen('m1')" onmouseout="mclosetime()">&#x25B6;</a>

<div id="m1" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
<a href="mybody.html" style="top:-9px; left: 16px">Quick Start</a>  
</div></li>
</ul>

# Javascript #
var timeout = 150;
var closetimer = 0;
var ddmenuitem = 0;

function mopen(id) {
mcancelclosetime();
if (ddmenuitem) ddmenuitem.style.visibility = 'hidden';
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';
}
function mclose() {
if (ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
function mclosetime() {
closetimer = window.setTimeout(mclose, timeout);
}
function mcancelclosetime() {
if (closetimer) {
    window.clearTimeout(closetimer);
    closetimer = null;
} 
}
document.onclick = mclose;

# CSS #
.menu div { 
position: absolute; visibility: hidden; margin: 0px 0px 0px 7px; padding: 0; width: 120px; height:62px; background: black;}

    .menu div a {position: relative; display: block; padding: 0px 0px 0px 0px; margin: -3px 0px 0px -9px; width: 105px; text-align: left; text-decoration: none; background: black; color: white; }
  • 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-06-06T09:27:49+00:00Added an answer on June 6, 2026 at 9:27 am

    Its not clear to me what the problem is, but you could try handling the mousedown at the document level and find the appropriate control yourself. Therefore you can decrease the sensitivty yourself.

    ie. something like the following pseudo-code

    document.onmousedown = mouseDown;
    
    function mouseDown(e)
    {
        for (int i=0; i < controls.Count; i++)
        {
            position = getAbsolutePosition(control[i);
            if ((e.x > control.x - 5) && (e.x < control.right + 5) &&
                (e.y > control.y - 5) && (e.y < control.bottom + 5))
            ... do something
    }
    

    The above code allows for a 5 pixel buffer around the control to still be considered part of the control. The “getAbsolutePosition” is to turn the controls co-ordinates into screen co-ordinates.

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

Sidebar

Related Questions

I have several situations where I need to pass multi-dimensional PHP arrays into Javascript/jQuery.
I have several pages that are all very similar. They have some javascript rollover
I have several HTML elements (buttons) that fire the same JQuery AJAX request. When
I call this functions on onmouseover and onmouseout for several divs. //Takes effect on
Have several questions. Don't flame me - I'm newbie, but eager to know more.
I have several questions regarding forms and PHP but if I should put them
I have the following code used for displaying several images changed on hover, but
I have several R functions that save files to drop box (mainly plots). This
I have several xml files with different node structure. I want to extract xml
I have several Delphi programs that maintain connections to a database (some Oracle, some

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.