Bootstrap Timepicker不显示(Bootstrap Timepicker not displaying)

我有一个模态窗口,我有一个表,用户可以选择时间。 在这个例子中,我能够让timepicker在表内工作。

$('.timepicker').timepicker().on('changeDate', function(ev){ $('.timepicker').timepicker('hide'); });

但是,在此示例中 ,时间选择器未显示。 没有例外被抛出。

I have a modal window where I have a table where the user can choose times. I was able to get the timepicker to work inside the tables in this example.

$('.timepicker').timepicker().on('changeDate', function(ev){ $('.timepicker').timepicker('hide'); });

However, in this example the timepicker is not displaying. There are no exceptions being thrown.

最满意答案

为了将来参考,您可以在其css上编辑此部分:

.bootstrap-timepicker-widget.dropdown-menu.open { display: inline-block; z-index: 10000; }

I ended up going with a jquery plugin which worked right out of the box for selecting the times.

HTML

<label><input id="mondayStartTime" type="text" style="width:100px" data-bind="value: mondayStartTime" class="time ui-timepicker-input"></input>Start</label> <label><input id="mondayEndTime" type="text" style="width:100px" data-bind="value: mondayEndTime" class="time ui-timepicker-input"></input>End</label>

Javascript

$('#mondayStartTime').timepicker(); $('#mondayEndTime').timepicker();

Available via CDN.

It works well inside the modal dialog.

Here is an example:

http://jsfiddle.net/jkittell/C8w8v/126/

更多推荐