trigger multiple keypress to stimulate keyboard shortcut jquery
问题 I want to create page zoom - according to keyboard shortcuts by jQuery. Mainly, I want to trigger Ctrl with + and Ctrl with - key pairs, when the user clicks on some element on the page. I have tried this code snippet from Way to trigger multiple keypress and hold events in jQuery question, but it does not work - it does not zoom the page $("#zoom").click(function() { var e = $.Event("keydown"); e.which = 61; // # key code for + e.ctrlKey = true; $(document).trigger(e); }); 回答1: Your event