javascript - 如何使Bootstrap日期和时间选择器向下打开而不是顶部-LMLPHP

日期和时间菜单是此列表中的第三个菜单,但它在最上方打开。
如何使它显示在“日期和时间选择器”窗体的底部?

    <link
      rel="stylesheet"
      href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
    />
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.css"
    />
    <link rel="stylesheet" href="./css/form.css" />

    <link href="css/Form.css" rel="stylesheet" />
    <script href="js/Form.js" rel="stylesheet"></script>

    <link
      rel="stylesheet"
      href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"
    />
  </head>

  <body>

    <div class="col-md-4">
      <input
        type="text"
        class="form-control js-datetimepicker"
        placeholder="When do you leave?"
        id="datetimepicker"
        data-toggle="dropdown"
      />
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/locale/nl-be.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.45/js/bootstrap-datetimepicker.min.js"></script>
    <script src="./js/form.js"></script>


```

最佳答案

尝试小部件定位:

$(function () {
    $('#yourpicker').datetimepicker({
        widgetPositioning: {
            horizontal: 'right',
            vertical: 'bottom'
        }
    });
});


文件here

关于javascript - 如何使Bootstrap日期和时间选择器向下打开而不是顶部,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58908471/

10-10 16:33