javascript - jquery timepicker not displaying dropdown - Stack Overflow

I am using jquery-timepicker, and it is not displaying the dropdown when I click on the input box. In m

I am using jquery-timepicker, and it is not displaying the dropdown when I click on the input box. In my view:

<script type="text/javascript">
$(function(){
    $('#StartTime').timepicker(); 
});
</script>
/* ... */
<div class="col-xs-6 form-group">
    <label>Start Time:</label>
        <div class="input-group">
            <input type="text" class="form-control"  id="StartTime" />
            <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
        </div>
</div>

I know it is loading properly, because the ui-timepicker element is being added to the DOM when I click on the input box and it formats time entered in the box when it loses focus. It just isn't displaying the dropdown.

I am using jquery-timepicker, and it is not displaying the dropdown when I click on the input box. In my view:

<script type="text/javascript">
$(function(){
    $('#StartTime').timepicker(); 
});
</script>
/* ... */
<div class="col-xs-6 form-group">
    <label>Start Time:</label>
        <div class="input-group">
            <input type="text" class="form-control"  id="StartTime" />
            <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
        </div>
</div>

I know it is loading properly, because the ui-timepicker element is being added to the DOM when I click on the input box and it formats time entered in the box when it loses focus. It just isn't displaying the dropdown.

Share Improve this question asked Nov 8, 2015 at 20:20 Musical ShoreMusical Shore 1,3813 gold badges20 silver badges42 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

Check that you have all the dependencies. I copied your code to a snippet and added the dependencies from the official site and it worked well. I included the following dependencies: jQuery, jQuery timepicker and Bootstrap timepicker. The last two have CSS and JS files too.

$(function() {
  $('#StartTime').timepicker();
});
<script type="text/javascript" src="https://ajax.googleapis./ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.js"></script>
<link rel="stylesheet" type="text/css" href="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.css">
<script type="text/javascript" src="https://jonthornton.github.io/jquery-timepicker/lib/bootstrap-datepicker.js"></script>
<link rel="stylesheet" type="text/css" href="https://jonthornton.github.io/jquery-timepicker/lib/bootstrap-datepicker.css">

<div class="col-xs-6 form-group">
  <label>Start Time:</label>
  <div class="input-group">
    <input type="text" class="form-control" id="StartTime" />
    <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
  </div>
</div>

Make sure there is no css definitions, which may hide this element.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744761741a4592215.html

相关推荐

  • javascript - jquery timepicker not displaying dropdown - Stack Overflow

    I am using jquery-timepicker, and it is not displaying the dropdown when I click on the input box. In m

    8天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信