2013-01-11 181 views

回答

1

您必須初始化事件第一:

var myCustomEvent = document.createEvent("Event"); 
myCustomEvent.initEvent("customEvent",true,true); 

然後觸發它:

document.dispatchEvent(myCustomEvent);