jQuery 键盘快捷键

news/2024/7/19 15:27:58 标签: jquery, js

1.给输入框绑定快捷键(以enter键为例)

 $(function(){
        $('#id').bind("keydown",function(event){
            if(event.keyCode == "13"){
                console.log("成功按下");
            }
        });
    })
  1. 给按钮添加键盘快捷键(以enter为例)
 $(function(){

        $(document).keydown(function(event){
            if(event.keyCode == "13"){
                $("#button").click()
            }
        });
    })

http://www.niftyadmin.cn/n/1263368.html

相关文章

含有软链接文件的压缩

在linux环境下 压缩含有软链接的文件,使用软件压缩会使软链接失效, 使用下面命令压缩 zip -r demo.zip demo/

使用命令删除文件 排除指定文件

在网上查到的命令是 rm -rf !(*.text|*.sh)在终端下执行是好使的 但是我需要再RCP中执行就不行了 后来使用find命令完成此功能 find -type f -not -name *.text -a -not -name *.sh -delete-type f:搜索文件 而非目录 -a :and 的意思

在Eclipse RCP中屏蔽第三方插件的扩展点

最近有个需求 需要屏蔽第三方插件的扩展点&#xff0c;查了相关资料 有个简单的方式 只需要实现一个扩展点org.eclipse.ui.activites,要实现这个扩展点&#xff0c;首先需要依赖插件org.eclipse.ui <extensionpoint"org.eclipse.ui.activities"><activityi…

注册cdt项目模版

1.扩展点org.eclipse.cdt.core.templates介绍 包括几个元素要配置 id&#xff1a;template的唯一id&#xff0c;不要求和template.xml中的id一致 location&#xff1a;template.xml的文件路径 projectType&#xff1a;需要填写模版关联的项目类型的id&#xff0c;提供给扩展点o…

eclipse插件开发小知识

打开对应的properties对话框 PropertyDialog.createDialogOn(shell,pageId,selection);打开对应的preference对话框 PreferencesUtil.createPreferenceDialogOn(shell,pageId,null,null);如果有这样的需求&#xff0c;一个地方的值改变&#xff0c;另一个地方的值也需要跟着改变…

OSGiBundle出现 Could not find bundle: org.eclipse.equinox.console的解决方案

根据《深入理解OSGI equinox 原理 应用与实践》一书中&#xff0c;第五章 HelloWorld实例配置run configuration时出现Could not find bundle: org.eclipse.equinox.console 和Could not resolve module: org.eclipse.equinox.console 错误&#xff0c;是因为Target Platform中…

eclipse开发远程调试配置

1.打开IDE目录下的eclipse.ini文件&#xff0c;添加 -agentlib:jdwptransportdt_socket,address192.168.1.72:6666,servery,suspendn也可以 ./eclipse -vmargs -agentlib:jdwptransportdt_socket,address192.168.1.72:6666,servery,suspendntransport指定了调试数据的传送方式…

mat2cell函数解析

在提取人脸的lbp特征时&#xff0c;看到mat2cell这个函数&#xff0c;在查阅了一些资料后在此记录一下。 1、什么是元胞数组 Cell Array也称为元胞数组&#xff0c;是matlab存储数据的一种特有的存储数据的类型。 使用形式就是&#xff1a;比如先定义了一个字符型的变量a&#…