我在哪里可以找到 Javascript/jQuery 中的时间范围小部件?
我在 Javascript/CSS/jQuery 中寻找某种 TimeRange 小部件.我不是在寻找广泛可用的时间/日期选择器.
I'm looking for some sort of TimeRange widget in Javascript/CSS/jQuery. I'm not looking for a time/date picker, which are widely available.
我需要一个网站,以允许企业通过单击并将鼠标悬停在营业时间上来选择营业时间.
I need it for a website to allow businesses to select their openinghours by clicking and hovering over the hours they're open.
+-----------------------------+
| 0h 0h15m 0h30m ... 23:45 |
+-----------------------------+
有人见过这么好看的可自定义时间范围选择器小部件吗?
Anybody has seen such a nice looking customizable timerange selector widget?
干杯
推荐答案
我会寻找一个滑块小部件..然后将您需要的时间设置为间隔.
I'd look for a slider widget.. then set the times you need as the intervals.
jQuery UI 有一个:jQuery UI Slider.
The jQuery UI has one: jQuery UI Slider.
更新:基于以下关于(单滑块与双滑块)的评论...
Update: based on the comment below about (single vs. double slider)...
1.) 已经有一篇文章(刚刚找到)关于使用此处的 jQuery UI 滑块制作 2 处理滑块.
1.) Theres a post already (just found) about making a 2 handled slider using the jQuery UI slider here.
或者,如果您有 2 个滑块……一个用于打开时间,一个用于关闭时间……每个都分为 15 分钟的片段,但每个片段只有半天,这会起作用吗?
Or if you have 2 sliders... one for opening time and one for closing... where each is broken down into 15min segments, but only for half a day each, would this work?
例如(忽略 ASCII 图形的丑陋)
e.g. (ignore the ASCII-graphic uglyness)
Open Time (AM): 12 1 2 3 4 5 6 7 8 | 9 10 11 12
^ 8:15am
Close Time (PM): 12 1 2 3 4 5 6 | 7 8 9 10 11 12
^6:30pm
此外,如果这是针对典型"业务的...您可能会从晚上 11 点 <-> 早上 5 点开始从滑块中切入.
Furthermore, if this is for "typical" businesses... you could likely chop from 11pm <-> 5am from the sliders.
或者,
我不是 scriptaculous 的忠实粉丝,但他们似乎有一个 双滑块:
I'm not a big fan of scriptaculous, but they seem to have a double slider:
相关文章