Event事件处理

function catchEvent(eventObj,event,eventHandler){

if(eventObj.addEventListener)

{

    eventObj.addEventListener(event,eventHandler,false);

}

else if(eventObj.attanchEvent)

{

    event="on"+event;

    event.attachEvent(event,EventHandler);

}

}

 

 

catchEvent("window","load",function(){

   document.getElementById("ln").style.display="block";

   document.getElementById("sd").style.display="none";

});

你可能感兴趣的:(Event事件处理)