向asp.net菜单添加键盘快捷键 [英] add a keyboard shortcut to asp.net menu
本文介绍了向asp.net菜单添加键盘快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
是否可以在asp.net菜单中添加键盘快捷键?
Hi
Is there a possibility to add a keyboard shortcut to asp.net menu ?
推荐答案
您可以使用此jQuery插件.非常容易使用:
http://rikrikrik.com/jquery/shortkeys/ [
You can use this jQuery plugin. Very easy to use:
http://rikrikrik.com/jquery/shortkeys/[^]
You can add more watch-keys (like ALT, CTRL etc)
this.wackyKeys = { '.': 190, ',': 188, ';': 59, 'Space': 32 };
添加快捷方式.触发点击菜单项.您将必须在菜单中找到a标签的ID.
Add shortcuts. Trigger click on your menuitems. You will have to find the ID of the a-tag in your menu.
// implement shortcuts
(document).shortkeys({ ' 空格+1':function(){
(document).shortkeys({ 'Space+1' : function () {
( ' #menuItem2').trigger(' 点击'); }, ' 空格+2':function(){
('#menuItem2').trigger('click'); }, 'Space+2' : function () {
这篇关于向asp.net菜单添加键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文