Ctrl + Key Combination – Simple Jquery Plugin

602 단어 jquery plugin
http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/

$.ctrl = function (key, callback, args) {
   $(document).keydown(function (e) {
      if (!args)
         args = []; // IE barks when args is null
      if (e.keyCode == key.charCodeAt(0) && e.ctrlKey) {
         callback.apply(this, args);
         return true;
      }
   });
};
$.ctrl('V', function (s) {
   setTimeout(function () {}, 10);
}, function () {
   return true;
});


좋은 웹페이지 즐겨찾기