jquery shortcuts not working on IE -
hi using jquery.hotkeys.js plug in key board shortcut. other shortcuts working fine f1 not working expected in ie. on 'f1' keypress binds shortcut being called more 1 time , opens window well.
the code this:
$(document).bind('keydown', 'f1', function (evt) { evt.preventdefault(); evt.stoppropagation(); alert('some message'); window.event.keycode = 0; return false; });
please give me idea this.
thanks
munish
in internet explorer, f1 key cannot cancelled keydown handler. can attach onhelp
event instead:
window.onhelp = function () { return false; }
the firing twice issue possibly bug in plugin code, if it's occurring in internet explorer can work around using onhelp
event exclusively:
if ("onhelp" in window) // ie window.onhelp = function() { alert("some message"); return false; } else // others $(document).bind('keydown', 'f1', function(evt) { alert('some message'); return false; });
Comments
Post a Comment