- 浏览: 733221 次
- 性别:
- 来自: 重庆
文章分类
- 全部博客 (194)
- Webservice (6)
- ExtJs (2)
- Work Summary (4)
- CoreJava (51)
- Spring (10)
- EJB (5)
- struts1.x (3)
- C/C++ (5)
- DatabaseManager (19)
- Hibernate (5)
- Crytology (1)
- Web Server (5)
- Software Manager (5)
- WebUi (39)
- Web page (2)
- android (5)
- struts2 (12)
- Java 导出 Excel (1)
- Spring 与struts2 和Hibernate 4.0注解解决方安 (1)
- Dwr (1)
- maven3 (4)
- Windows (3)
- 表格头部信息不动使用Jquery 外部框架 (1)
- 软件行业动态 (1)
- mybatis (1)
- C# (3)
- MySQL (4)
最新评论
-
July01:
最近了解到一款StratoIO打印控件,功能如下:1、Html ...
LODOP插件开发 -
an52036:
u010980147 写道您的代码确实能生成条形码,但是打印出 ...
Java 条形码生成(一维条形码) -
di1984HIT:
学习了,很好~~
Ant 打包war 生成文件内容build.xml -
lhb319lhb:
如果 ajax(jquery)更新了 iframe 的 src ...
jquery 修改iframe src -
calosteward:
感谢楼主,除了一维条码,有没有相关二维码的资源呢?______ ...
Java 条形码生成(一维条形码)
js 实现原理备
/** * http://www.openjs.com/scripts/events/keyboard_shortcuts/ * Version : 2.01.B * By Binny V A * License : BSD */ shortcut = { 'all_shortcuts':{},//All the shortcuts are stored in this array 'add': function(shortcut_combination,callback,opt) { //Provide a set of default options var default_options = { 'type':'keydown', 'propagate':false, 'disable_in_input':false, 'target':document, 'keycode':false } if(!opt) opt = default_options; else { for(var dfo in default_options) { if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo]; } } var ele = opt.target; if(typeof opt.target == 'string') ele = document.getElementById(opt.target); var ths = this; shortcut_combination = shortcut_combination.toLowerCase(); //The function to be called at keypress var func = function(e) { e = e || window.event; if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields var element; if(e.target) element=e.target; else if(e.srcElement) element=e.srcElement; if(element.nodeType==3) element=element.parentNode; if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return; } //Find Which key is pressed if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; var character = String.fromCharCode(code).toLowerCase(); if(code == 188) character=","; //If the user presses , when the type is onkeydown if(code == 190) character="."; //If the user presses , when the type is onkeydown var keys = shortcut_combination.split("+"); //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked var kp = 0; //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken var shift_nums = { "`":"~", "1":"!", "2":"@", "3":"#", "4":"$", "5":"%", "6":"^", "7":"&", "8":"*", "9":"(", "0":")", "-":"_", "=":"+", ";":":", "'":"\"", ",":"<", ".":">", "/":"?", "\\":"|" } //Special Keys - and their codes var special_keys = { 'esc':27, 'escape':27, 'tab':9, 'space':32, 'return':13, 'enter':13, 'backspace':8, 'scrolllock':145, 'scroll_lock':145, 'scroll':145, 'capslock':20, 'caps_lock':20, 'caps':20, 'numlock':144, 'num_lock':144, 'num':144, 'pause':19, 'break':19, 'insert':45, 'home':36, 'delete':46, 'end':35, 'pageup':33, 'page_up':33, 'pu':33, 'pagedown':34, 'page_down':34, 'pd':34, 'left':37, 'up':38, 'right':39, 'down':40, 'f1':112, 'f2':113, 'f3':114, 'f4':115, 'f5':116, 'f6':117, 'f7':118, 'f8':119, 'f9':120, 'f10':121, 'f11':122, 'f12':123 } var modifiers = { shift: { wanted:false, pressed:false}, ctrl : { wanted:false, pressed:false}, alt : { wanted:false, pressed:false}, meta : { wanted:false, pressed:false} //Meta is Mac specific }; if(e.ctrlKey) modifiers.ctrl.pressed = true; if(e.shiftKey) modifiers.shift.pressed = true; if(e.altKey) modifiers.alt.pressed = true; if(e.metaKey) modifiers.meta.pressed = true; for(var i=0; k=keys[i],i<keys.length; i++) { //Modifiers if(k == 'ctrl' || k == 'control') { kp++; modifiers.ctrl.wanted = true; } else if(k == 'shift') { kp++; modifiers.shift.wanted = true; } else if(k == 'alt') { kp++; modifiers.alt.wanted = true; } else if(k == 'meta') { kp++; modifiers.meta.wanted = true; } else if(k.length > 1) { //If it is a special key if(special_keys[k] == code) kp++; } else if(opt['keycode']) { if(opt['keycode'] == code) kp++; } else { //The special keys did not match if(character == k) kp++; else { if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase character = shift_nums[character]; if(character == k) kp++; } } } } if(kp == keys.length && modifiers.ctrl.pressed == modifiers.ctrl.wanted && modifiers.shift.pressed == modifiers.shift.wanted && modifiers.alt.pressed == modifiers.alt.wanted && modifiers.meta.pressed == modifiers.meta.wanted) { callback(e); if(!opt['propagate']) { //Stop the event //e.cancelBubble is supported by IE - this will kill the bubbling process. e.cancelBubble = true; e.returnValue = false; //e.stopPropagation works in Firefox. if (e.stopPropagation) { e.stopPropagation(); e.preventDefault(); } return false; } } } this.all_shortcuts[shortcut_combination] = { 'callback':func, 'target':ele, 'event': opt['type'] }; //Attach the function with the event if(ele.addEventListener) ele.addEventListener(opt['type'], func, false); else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func); else ele['on'+opt['type']] = func; }, //Remove the shortcut - just specify the shortcut and I will remove the binding 'remove':function(shortcut_combination) { shortcut_combination = shortcut_combination.toLowerCase(); var binding = this.all_shortcuts[shortcut_combination]; delete(this.all_shortcuts[shortcut_combination]) if(!binding) return; var type = binding['event']; var ele = binding['target']; var callback = binding['callback']; if(ele.detachEvent) ele.detachEvent('on'+type, callback); else if(ele.removeEventListener) ele.removeEventListener(type, callback, false); else ele['on'+type] = false; } }
- Bs快捷键.rar (33.9 KB)
- 下载次数: 1
发表评论
-
CSS IE 兼容
2017-09-06 23:07 467padding:10px; padding:9px\9; ... -
JavaScript 精度丢度丢失
2017-06-16 15:34 1269Snandy If you cannot hear t ... -
JS parent 及openner
2016-05-11 09:32 1128window.parent与window.openner区别 ... -
easyui combobox模糊匹配
2016-01-02 00:16 3546代码结果 1)html代码 <sele ... -
LODOP插件开发
2015-09-22 19:45 7537function zkPreview() { LO ... -
窗体居中显示
2015-09-21 17:06 7501) 居中显示窗体 function(jqueryO ... -
JS 拖动效果
2015-08-13 11:51 872原理 A(Xs,Ys)、B(Xd,Yd) Xj ... -
Web分页控件封闭
2015-08-08 18:06 13031)引入对应JS源码 jquery.simplePagina ... -
easyui selectRecord 选中行
2015-03-20 09:06 83481) 表格datagrid 只要加入idFiel ... -
easyui queryParam 自动化
2015-02-13 11:25 1382/** * @author LiuQing * ... -
Combo通用类型封装
2014-01-20 16:30 10321.Combobox封闭 <%@ page lan ... -
ComboBox简单开发
2014-01-20 00:21 10571.原理 不多讲了:div 显示+input 及显 ... -
js获取项目根路径
2014-01-14 17:59 13529//js获取项目根路径,如: http://localhos ... -
jquery 分面控件
2013-12-24 17:14 8081.详见发下 -
Js 移动焦点和被选择
2012-06-16 19:16 1628document.getElementById('vege ... -
iframe 使用技巧
2012-04-05 22:04 1226<div style="width:10 ... -
Jquery UI
2012-03-16 01:36 1523<!DOCTYPE html PUBLIC &qu ... -
Jquery Tip 插件使用
2012-02-17 11:31 8842@author liuqing 1. 使用方法 < ... -
JavaScript 刷新页面函数
2012-02-08 10:33 1158JavaScript 刷新页面函数 locati ... -
不同的浏览器载入不同的样式
2011-11-21 21:40 1094<link rel="styleshee ...
相关推荐
Study note on htis keyword in JavaScript
keyword-color.js
is-keyword-js 检查给定的字符串是否为 Javascript 关键字或为将来的关键字保留。 安装 $ npm install --save is-keyword-js 用法 var isKeyword = require ( 'is-keyword-js' ) ; isKeyword ( 'this' ) ; // ...
使用特定关键字获取npm软件包的数量。 安装 # Globally for a user: npm install --global keyword-popularity # …or locally for a project: npm install --save-dev keyword-popularity 用法 概要 Usage: ...
$ browserify sample.js -o bundle.js 运行测试 要运行测试套件,请首先通过在软件包目录中运行以下命令来安装开发依赖项。 $ npm install 要执行软件包的测试,请运行: $ make test 模块的用途 // include the...
前端项目-mark.js,A keyword highlighter for search terms or regular expressions
关键字抓取器 通过抓取Google为之提供的... 运行它: node scraper.js --keyword="<keyword>" --limit=<limit> --file="<output>" 例如: node scraper.js --keyword="web scraping" --limit=50 --file="keywords.txt
本文主要给大家介绍的是关于js输入关键字添加标签效果的相关内容,分享出来供大家参考学习,下面来看看详细的介绍: 实现功能: 输入关键字加空格键添加tag标签 按Backspace键删除一个标签 输入关键字后,鼠标...
meta http-equiv=”keywords” content=”keyword1,keyword2,keyword3″> <meta http-equiv=”description” content=”this is my page”> <meta http-equiv=”content-type” content=”text/html; ...
xingwa-baidu-keywordUSAGEvar httpClient = require("xingwa-baidu-keyword").httpClient// 获取网页内容var stringData = httpClient.requestSync('http://www.eg.com', 3000, 'utf-8', function (err, res){ ...
一般主流浏览器皆适用(IE11可)使用方式和一般js元件方式相同,一般建议放至区域底部,例如[removed][removed]载入页面即导向直接以范例说明: routing.config([ { path: "search.html?keyword={keyword}",...
v-mai-keyword-highlight Vue.js 2的插件,突出显示了关键字(到目前为止仅支持一个关键字)。 。安装NPM运行npm install --save v-mai-keyword-highlight 带模块 // ES6import Vue from 'vue'import vMaiPlugins ...
Javascript APK搜寻器 该程序使用node.js抓取数据并抓取托管Android APK的各种网站。用法apkJSCrawler <command> 命令: keyword <keyword> <output> <plugin> Download apps by the given keyword.file <keyword> ...
JS-搜索引擎 搜索引擎 JavaScript 代码 浏览器支持 火狐 4+ Chrome 29+ 歌剧 16+ 野生动物园 8+ ##Use Like window.SearchEngine.submit(keyword, engine[, type]); 或者 window.SearchEngine.submit({ ...
前言 swiper这是一个很强大的轮播展示工具,但往往也会有一些未知BUG,尤其是在手机端,由于性能局限,会导致效果和PC测试的时候有完全不一样的效果 在H5项目中,需要用到...Swiper.js 这个 npm 包里面还使用了 dom7
You will learn about the 'this' keyword, as well as new object tools. You will be able to create reusable code with encapsulation, overloading and inheritance. The most recent techniques for debugging...
入门使用degit 要在本地基于汇总创建一个新的Sapper项目,请运行npx degit " sveltejs/sapper-template#rollup " my-app 对于基于Webpack的项目,请运行npx degit " sveltejs/sapper-template#webpack " my-app 是一...
You will learn about the 'this' keyword, as well as new object tools. You will be able to create reusable code with encapsulation, overloading and inheritance. The most recent techniques for debugging...
在很多大网站上为了提高用户方便阅读文字,都提供有字体大小选择功能,以适应不同年龄段...meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is