2

我正在寻找某种 Javascript 时间选择器的示例,它类似于 Windows 中用于选择时间的那个......好吧,除了没有秒数。我目前有一个模型,但试图弄清楚一些用户功能应该是怎样的,因为它是两个输入和一个下拉菜单。我想我现在对此并不满意。提前感谢您的帮助

4

7 回答 7

4

有许多 jQuery 插件可用于完美的时间选择器控件。

这是一个很好的: http: //plugins.jquery.com/project/timepicker

于 2009-05-26T16:40:05.633 回答
1

Windows 时间选择器(如果您指的是更改系统时钟的选择器)基本上只是一个蒙面的编辑文本框。如果您正在寻找类似的东西,您只需要一些 JavaScript 来进行蒙版编辑,例如:

http://digitalbush.com/projects/masked-input-plugin/

为了专门针对时间,您应该能够轻松添加逻辑以确保小时不超过 12(或 24),分钟不超过 59。

就个人而言,我更喜欢 Google 日历选择时间的方式。有一个 jQuery 插件可以在这里找到:

http://labs.perifer.se/timedatepicker/

于 2009-05-26T16:47:08.100 回答
0

这是一个很酷的。

http://www.java2s.com/Code/JavaScript/GUI-Components/FancyTimePicker.htm

此处发布了该控件的在线示例。

于 2009-05-26T16:38:28.133 回答
0

我很喜欢 jQuery 的东西,这里有一个相当不错

于 2009-05-26T16:45:58.587 回答
0

Like Dan said, if you are looking for a masked text input and if you want to use the PrototypsJS framework, there is http://code.google.com/p/phenx-web/ . And if you want a good date/time picker, you could use this : http://home.jongsma.org/software/js/datepicker (also PrototypeJS). I'm currently working on it with Jerermy Jongsma to add more features.

于 2009-05-26T16:57:28.640 回答
0

I ended up creating a prototype time picker that for the time being is less fancy than a lot of the others out there. It shows up a regular input until you click on it then it shows a dropdown that has times in it. I can share the code if anyone is interested

于 2009-06-09T19:11:43.993 回答
0

A timepicker shouldn't slow down the user's interaction, should be pretty straightforward without having to play with it for a while, and should be keyboard-accessible for users who can't manipulate a mouse. The time-picking functionality provided by the Any+Time™ Datepicker/Timepicker AJAX Calendar Widget with TimeZone Support meets all of these design goals, supports countless date/time formats and is easy to customize using CSS or jQuery UI.

A good test of timepicker usability is to think of an odd time (say, 10:32pm) and then see how long it takes to accurately select that time using various time pickers. You can probably do it with Any+Time™ faster than you can even write out the time by hand... how's that for speed and ease of use? :-p

于 2010-04-26T13:39:01.547 回答