Skip to content

Instantly share code, notes, and snippets.

View ineo6's full-sized avatar
🎯
Focusing

ineo6 ineo6

🎯
Focusing
View GitHub Profile
@ineo6
ineo6 / gist:63d4ea907d042c706bd692c7c09e8574
Created April 13, 2016 06:41
jquery input number validator
$.fn.numeral = function() {
this.bind("keydown",
function(e) {
// Allow: backspace, delete, tab, escape and enter
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110]) !== -1 ||
// Allow: Ctrl+A, Command+A
(e.keyCode == 65 && (e.ctrlKey === true || e.metaKey === true)) ||
// Allow: home, end, left, right, down, up
(e.keyCode >= 35 && e.keyCode <= 40)) {
// let it happen, don't do anything
@ineo6
ineo6 / index.js
Last active August 15, 2019 02:09
npm package with gist - npm包的示例
console.log('hello world');