jquery 输入数字
制作 +(加号)和 -(减号)值按钮
如何为< /代码>?
我认为可以使用 jQuery 或简单的 javascipt 来完成,但我不知道如何..
我想做这样的事情:
当您按下 + 按钮时,数值将变大 1 (0,12,3,4,5,6.... 10000)
当您按下 - 按钮时,数值将变 大小于 1 (10,9,8,7,6,5,4...0)
Possible Duplicate:
Is it possible to customize an input field for amounts with +- buttons?
how to make + (plus) and - (minus) value buttons for
<input type="number" class="numbertype" value="10">
?
I think it's possible to do with jQuery or maybe simple javascipt, but i don't know how..
I want do something like this :
when you push on + button, value will be bigger for 1 (0,12,3,4,5,6.... 10000)
when you push on - button, value will be smaller for 1 (10,9,8,7,6,5,4... 0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我只是想看看自己该怎么做。这是一个在鼠标按下时继续进行的切换:
工作示例: http://jsfiddle.net/M4BAt/5/
I just wanted to see how to do it myself. Here's a toggle that will keep going on mouse down:
working example: http://jsfiddle.net/M4BAt/5/
如果您用所需的图像替换加号/减号按钮,这将起作用:
工作示例: http://jsfiddle .net/jfriend00/FxEv3/
对于图像,HTML 将如下所示(使用图像 URL):
If you substitute the images you want for the plus/minus buttons, this would work:
Working example: http://jsfiddle.net/jfriend00/FxEv3/
With images, the HTML would look like this (using your image URLs):
您可以使用kendo.iu,它具有预定义的控件,更能满足您的愿望。它非常容易实现并且效果很好。我已经用过了。没有抱怨。
http://demos.kendoui.com/web/numerictextbox/index.html
You can use the kendo.iu it has predefined control satisfying your wishes even more.It is very easy to implement and works great. I have already used it. No complains.
http://demos.kendoui.com/web/numerictextbox/index.html