homepage Welcome to WebmasterWorld Guest from 54.226.43.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Checking mouse leaves window
I want to terminate mouse over effects when mouse is out of window
jetteroheller




msg:3828550
 7:57 pm on Jan 17, 2009 (gmt 0)

On my web site are several mouse over effects creating an overlay over the content area.

I watch with mouse over routines 3 recktangles

The object creating the mouse over
A bridge to the overlay
The overlay

When the mouse is out of all 3 objects, the mosue over effect is terminated.

But when the mouse leaves the window where the page is shown, the mouse over effect remains.

How can I controll, that the mouse over leaves the window?

 

korkus2000




msg:3829555
 3:19 pm on Jan 19, 2009 (gmt 0)

I don't think there is an event for when the mouse leave the browser that you can capture. Why is it an issue? Maybe there is another solution.

penders




msg:3829626
 4:37 pm on Jan 19, 2009 (gmt 0)

When the mouse is out of all 3 objects, the mosue over effect is terminated.

On what event are you currently triggering this?

jetteroheller




msg:3829632
 4:49 pm on Jan 19, 2009 (gmt 0)

if(document.all){document.onmousemove=ocmie}
if(typeof(document.addEventListener)=="function")
{document.addEventListener("mousemove",ocmmoz,true)}

So standard different handlers for Mozilla or MSIE similar browsers

The event handler checks 3 rectangles for the mouse.

OVERLAY BRIDGE
OVERLAY BRIDGE MENU
OVERLAY BRIDGE
OVERLAY
OVERLAY
OVERLAY

The menu point which activates the effect, a bridge to the overlay, to move the mosue to the overlay and the overlay obejct

penders




msg:3829642
 5:06 pm on Jan 19, 2009 (gmt 0)

When the mouse is out of all 3 objects, the mosue over effect is terminated.

Have you tried attaching to the onmouseout event?

jetteroheller




msg:3829669
 5:36 pm on Jan 19, 2009 (gmt 0)

Just tried

document.body.onmouseout=alert("HALLO");

error: not implemented

How would you implement mouseout for the body?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved