View Full Version : window.onblur -- how does this work?

01-08-2007, 05:19 PM
Hi all...
I have a little problem.

I want to be able to detect when the user moves away from the current active browser window.

The reason i want to do this is because i have a dhtml menu which remains open no matter what.

so this is what i want to do..


but the code isnt executed when i move away from the window!
can someone help me with this?

i've also tried this:


function closeMenus(){

<body topmargin="0" leftmargin="0" onblur="closeMenus()">

and its not working

I cant post the whole menu code because its VERY long, but i know the
menuBar.closeAllMenus() instruction works.. i've tried it with

function closeMenus(){

and sure enough every second all the menus are closed.

is there another way to know if the user is leaving the window?

right now the page is divided into 2 frames, im working with the top frame where the menu is.

does that affect the behaviour of window.onblur ?

01-08-2007, 11:21 PM
Can you post a link to the page? Why not just do a setTimeout() onmouseout of each link?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum