Click to See Complete Forum and Search --> : HELP: in how to detect focus


hys
05-01-2003, 04:51 AM
Does anyone know how we can detect if the window has just recieved focus and react to the focus.

E.g. when the window is focused maximize the screen

gil davis
05-01-2003, 05:43 AM
There is an onfocus() event that will trigger when the window gains focus.

hys
05-01-2003, 06:10 AM
yes i just realised ... and just placed it into the body .. however this is in frames ... so how do i get the whole window to react if the window got focus

would i have to put the script on every frame.

AdamBrill
05-01-2003, 07:36 AM
Put this script in your main page(your frameset page) in the head:<script language=javascript>
function winFocused(){
alert("test");
}
window.onfocus=winFocused;
</script>It will run the winFocused() function every time the window is focused...