【问题标题】:Bootstrap Datepicker not Auto closing on dom clickBootstrap Datepicker 不会在 dom 点击时自动关闭
【发布时间】:2015-10-28 08:16:25
【问题描述】:

如果我在元素外部单击,我的引导日期选择器不会自动关闭。

    <div class="formInput input-group">
         <input type="text" class="datepicker form-control" id="dateQuoteBid" readonly="readonly" />
         <label for="dateQuoteBid" class="input-group-addon">
           <i class="glyphicon glyphicon-calendar"></i>
         </label>
    </div>

和我的 Js

  $(function ()
    {
      $('.datepicker').datepicker({
            format: 'dd/mm/yyyy',
            todayHighlight: 'TRUE',
            autoclose: true,
        });
    });

http://jsfiddle.net/vh1oknf7/95/

在上面的 Js Fiddle Auto 关闭工作,但不是在我的本地, 我已经直接从 gitHub 更新了 Js 文件

另一个问题是看小提琴中的箭头按钮,它指向相反的方向,而不是指向文本框。

【问题讨论】:

  • 您使用的是哪个版本的bootstrap?另外,您在哪个浏览器中看到问题?
  • @eric Bootstrap v3.3.5 和浏览器 chrome

标签: html twitter-bootstrap bootstrap-datepicker


【解决方案1】:

希望对你有帮助。

<div class="well">
  <div id="datetimepicker1" class="input-append date">
    <input data-format="dd/MM/yyyy hh:mm:ss" type="text"></input>
    <span class="add-on">
     <i data-time-icon="icon-time" data-date-icon="icon-calendar"> </i>
    </span>
  </div>

<script type="text/javascript">
  $(function() {
    $('#datetimepicker1').datetimepicker({
      language: 'pt-BR'
    });
  });
</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-07
    • 2019-06-22
    • 2021-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-19
    相关资源
    最近更新 更多