Welcome to WebmasterWorld Guest from 54.160.254.203

Forum Moderators: open

Message Too Old, No Replies

Checking mouse leaves window

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

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

Senior Member

WebmasterWorld Senior Member jetteroheller is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 22, 2005
posts: 2979
votes: 1


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?

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

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 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.
4:37 pm on Jan 19, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0


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

On what event are you currently triggering this?

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

Senior Member

WebmasterWorld Senior Member jetteroheller is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 22, 2005
posts: 2979
votes: 1


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

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

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0


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

Have you tried attaching to the onmouseout event?

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

Senior Member

WebmasterWorld Senior Member jetteroheller is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 22, 2005
posts: 2979
votes: 1


Just tried

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

error: not implemented

How would you implement mouseout for the body?