开发者

IE firing anything else but click

I just wonder is there's any way to fire any event via IE's event-triggering implementation - fireEvent. I've tried to use it but fai开发者_如何学JAVAled with all event except click.

The only reason I've get interested with this issue is curiosity, thus, any answers like "just do not trigger events, it is a bad idea" - all such answers would be considered, well...not full)))


i had problems with that too, but jquery sometimes works, give it a try:

var eventObject = {};
eventObject.type = 'keydown';
eventObject.ctrlKey = true;
eventObject.altKey = false;
eventObject.shiftKey = false;
eventObject.metaKey = false;
eventObject.screenX = false;
eventObject.screenY = false;
eventObject.clientX = false;
eventObject.clientY = false;
eventObject.relatedTarget = this;
eventObject.button = false;
eventObject.keyCode = 80;
eventObject.charCode = 0;
eventObject.bubbles = false;
eventObject.cancelable = false;
eventObject.windowObject = false;
eventObject.detail = false;
$(document).trigger({type: 'keydown', ctrlKey: true, altKey: false, which: 80, originalEvent:eventObject });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜