keithamus / jwerty

⌨ Awesome handling of keyboard events
http://keithamus.github.io/jwerty
Other
1.21k stars 109 forks source link

extend .key() method can delegate binding if using jQuery or Zepto #29

Closed dishuostec closed 11 years ago

dishuostec commented 11 years ago

This feature need jQuery or Zepto. usage: jwerty.key('ctrl+enter', function(){...}, '.element_currentlynot exist'); jwerty.key('ctrl+enter', function(){...}, '.element_currentlynot exist_too', '.wrap_element');

and we can use like this: $('.wrap_element').jwerty('ctrl+enter', function(){}); $('.wrap_element').jwerty('ctrl+enter', '.element_currently_not_exist', function(){});

keithamus commented 11 years ago

I think this can be done a bit more cleanly. So while I like the idea of event delegation, I'm not going to accept this particular implementation.