一、例如:
var divModifyCategory = document.createElement("div");
divModifyCategory.id = "divModifyCategory";
divModifyCategory.style.border = "0.05cm ridge #FACBA0";
divModifyCategory.style.position = "absolute";
divModifyCategory.style.background = "#FFFFFF";
divModifyCategory.style.width = "460px";
二、增加响应事件,支持IE、Firefox
addEventHandler(divModifyCategory,'click',HideMyCategory);//mouseout
三、主要函数
function addEventHandler(oTarget, sEventType, fnHandler)
{
if (oTarget.addEventListener)
{
oTarget.addEventListener(sEventType, fnHandler, false);
} else if (oTarget.attachEvent) {
oTarget.attachEvent("on" + sEventType, fnHandler);
} else {
oTarget["on" + sEventType] = fnHandler;
}
}
var divModifyCategory = document.createElement("div");
divModifyCategory.id = "divModifyCategory";
divModifyCategory.style.border = "0.05cm ridge #FACBA0";
divModifyCategory.style.position = "absolute";
divModifyCategory.style.background = "#FFFFFF";
divModifyCategory.style.width = "460px";
二、增加响应事件,支持IE、Firefox
addEventHandler(divModifyCategory,'click',HideMyCategory);//mouseout
三、主要函数
function addEventHandler(oTarget, sEventType, fnHandler)
{
if (oTarget.addEventListener)
{
oTarget.addEventListener(sEventType, fnHandler, false);
} else if (oTarget.attachEvent) {
oTarget.attachEvent("on" + sEventType, fnHandler);
} else {
oTarget["on" + sEventType] = fnHandler;
}
}