...

View Full Version : window.event workaround in Firefox?



JBChris
07-11-2005, 11:42 PM
Okay Everyone,
I need to know soon: Is there a workaround for window.event.toElement in Firefox?
I need to check if on MouseOut the mouse goes to the <body> or another <img> tag.
If anyone can help I would be most grateful. If I need to clarify just ask.

Thanks,
Josh

glenngv
07-12-2005, 03:00 AM
function getSourceTag(evt){
if (!evt) evt = window.event;
var el = (evt.srcElement) ? evt.srcElement : (evt.target) ? evt.target : null;
if (el){
window.status = el.tagName; //debug
switch(el.tagName){
case "BODY":
alert("body");
break;
case "IMG":
alert("image");
break;
//...
}
}
}
...
<body onmouseover="getSourceTag(event)">

JBChris
07-12-2005, 09:11 PM
Thank you very much! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum