如何使用微调器jquery在单个输入中创建一个小时分钟选择器? [英] How to create a hour minute time selector in single input using spinner jquery?

查看:63
本文介绍了如何使用微调器jquery在单个输入中创建一个小时分钟选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< input id =spinnername =value>

< input id =spinner1name =value>



<input id="spinner" name="value">
<input id="spinner1" name="value">

$("#spinner").spinner();
$("#spinner1").spinner();





这样我就可以在1个文本框中创建2个输入。



它应该像



11:25



如果指针在11上,我点击旋转箭头,它应该增加只有11到12

如果指针在25上它应该增加25到30,增加+5。



注意:我想要两个小时和分钟只有1个文本框中的':'分隔符。



我尝试过的方法:



我试过这个



< input id =spinnername =value>

< input id =spinner1name =value>





This creates 2 inputs i want in one them in 1 textbox.

It should be like

11:25

If pointer is on 11 and i click up arrow of spinner it should increase only 11 to 12
and if pointer is on 25 it should increase 25 to 30 with +5 increment.

Note: I want both hours and minute with ':' seperator in 1 Textbox only.

What I have tried:

I have tried this

<input id="spinner" name="value">
<input id="spinner1" name="value">

$("#spinner").spinner();
$("#spinner1").spinner();





但这会创建2个带有微调器箭头的文本框,我希望在其中一个用HOUR:分钟格式



but this creates 2 textbox with spinner arrows i want in one with HOUR:Minute format

推荐答案

#spinner)。spinner();
("#spinner").spinner();


#spinner1)。spinner();
("#spinner1").spinner();





这样就可以在1个文本框中创建2个输入。



它应该像



11:25



如果指针在11上,我点击旋转箭头,它应该只增加11到12

如果指针在25上,它应该增加25到30,增加+5。



注意:我想要小时和分钟':'分隔符只在1个文本框中。



我尝试过:



我有tr这个



< input id =spinnername =value>

< input id =spinner1name =value>





This creates 2 inputs i want in one them in 1 textbox.

It should be like

11:25

If pointer is on 11 and i click up arrow of spinner it should increase only 11 to 12
and if pointer is on 25 it should increase 25 to 30 with +5 increment.

Note: I want both hours and minute with ':' seperator in 1 Textbox only.

What I have tried:

I have tried this

<input id="spinner" name="value">
<input id="spinner1" name="value">


#spinner)。spinner();
("#spinner").spinner();


这篇关于如何使用微调器jquery在单个输入中创建一个小时分钟选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆