jQuery Prevent Default Action Function Keys (F3, F4, etc.)

后端 未结 2 1975
逝去的感伤
逝去的感伤 2021-01-16 15:31

I have this extremely basic example here: http://jsfiddle.net/arhVd/1/

相关标签:
2条回答
  • 2021-01-16 15:47

    I don't believe you can hi-jack the user's browser.

    0 讨论(0)
  • 2021-01-16 16:03

    This seems to work for F3 in IE8:

    $(document).keydown(function(event) {
      event.preventDefault();
    
      if (event.keyCode == 114) { // F3
        // Remap F3 to some other key that the browser doesn't care about
        event.originalEvent.keyCode = 0;
      }
    };
    

    (based on http://www.fixya.com/support/t218276-disable_f3_function_key_from_intenet)

    0 讨论(0)
提交回复
热议问题