PDA

View Full Version : Blur/Focus



holobyted
06-01-2005, 10:48 PM
Hey all. I was just wondering if anyone here knew the "correct" (aka, cross-browser) way to run a function when the window has the current focus, and run another one when it loses the focus.

I've tried the obvious window.onblur, window.onfocus, document.onblur and document.onfocus, however, IE doesn't like these events for some reason. Either that or it just doesn't like me. (IE does it right the first time, but if you make the window lose focus again, it doesn't do anything once it gains focus... weird.)

Would anyone be able to point me in the right direction?

Thanks.

-h