有没有办法强制数字键盘出现在手机上<input type="text">?我刚刚意识到<input type="number">在HTML5中是针对"浮点数",因此它不适用于信用卡号,邮政编码等.
我想模拟数字键盘功能<input type="number">,对于采用浮点数以外的数值的输入.也许还有另一种合适的input类型吗?
我试图在每个实例上发生一些事情,除非有一个禁用的类,但.not()似乎不起作用.这是我的简短版本:
if($(this).not('.Disabled')){
-Do Something-
}
Run Code Online (Sandbox Code Playgroud)
但是,如果我扭转它,即
if($(this).is('.Disabled')){
-Do Something-
}
Run Code Online (Sandbox Code Playgroud)
然后"是"将在一个具有"禁用"类的元素上工作有点混淆从哪里开始.
var ProdWidth = Math.abs(parseInt(Product.css('width')))
+ Math.abs(parseInt(Product.css('marginLeft')))
+ Math.abs(parseInt(Product.css('marginRight')))
+ Math.abs(parseInt(Product.css('paddingLeft')))
+ Math.abs(parseInt(Product.css('paddingRight')));
Run Code Online (Sandbox Code Playgroud)
这适用于提出元素的总宽度,包括填充和边距,但它的愚蠢.我应该怎么做?
jquery ×2
android ×1
code-cleanup ×1
html-input ×1
ios ×1
javascript ×1
keyboard ×1
numbers ×1