格式化Event
var EventUtil = new Object;
Eventutil.formatEvent =function(oEvent){
if(isIE && isWin) {
oEvent.charCode = (oEvent.type == "keypress") ? oEvent.keyCode : 0;
oEvent.eventPhase = 2;//代表冒泡阶段,仅IE支持这个阶段
oEvent.isChar = (oEvent.charCode >0)
oEvent.pageX = oEvent.clientX + document.body.scrollLeft;
oEvent.pageY = oEvent.clientY + document.body.scrollTop;
oEvent.preventDefault = function() //阻止事件默认行为 {
this.returnValue = false;
}
if(oEvent.type == "mouseout") {
oEvent.relatedTarget = oEvent.toElement;
}
if(oEvent.type == "mouseover") {
oEvent.relatedTarget = oEvent.fromElement;
}
oEvent.stopPropagation() = function() //阻止冒泡 {
this.cancelBubble = true;
}
oEvent.target = oEvent.srcElement;
oEvent.time = (new Date()).getTime();
}
return oEvent;
};