[Javascript] Suppressing mouse-over events

Håkan Magnusson hakan at backbase.com
Wed Mar 24 06:10:35 CST 2004


This smells of IE specific stuff to me, but I'll give it a shot anyway. :)

Have onfocus and onblur-handlers on the window that contains your menu, 
setting a variable (bFocus = true/false) when the window focus is 
changed. On the onmouseoverevent all you have to do is check the bFocus 
variable. If it's false, then your window is out of focus, so don't 
display the menu.

Makes any sense? :)

Regards,
H

Matt Barton wrote:

> Hi,
> 
> I'm coding for a system (compatibility with IE5.5+, other browsers are not
> an issue) which uses the onMouseOver event of a graphic to popup a menu (the
> menu appears in a popup object - as in window.createPopup()).
> 
> What I'm trying to do is suppress the onMouseOver event when the browser is
> not the top-most window.  The situation my users are getting is that they'll
> be using the app then alt-tab away to their email or some other application,
> but if the menu-triggering graphic is still on the screen, the onMouseOver
> event will still fire and display the menu *over the topmost application*.
> 
> I'm not convinced that there is a simple way to do this (and that's what I
> told my boss!), but thought I'd be better off asking the list...
> 
> Any help greatly appreciated,
> 
> Matt
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 



More information about the Javascript mailing list