function getEvent()
{
var i = 0;
if(document.all){
return window.event;
}
func = getEvent.caller;
while(func != null)
{
var arg0 = func.arguments[0];
if(arg0)
{
if(arg0.constructor == MouseEvent)
{
return arg0;
}
}
func = func.caller;
}
return null;
}
函数中要引用须传参e才能等到:
function buttonOver(e)
{
e = getEvent();
var obj = e.srcElement || e.target;
if (obj.runtimeStyle){
obj.runtimeStyle.cssText = "background-color:#FFFFFF";
}
else
obj.style.background = "#FFFFFF";
}