简体   繁体   English

Bootstrap Datepicker定位不起作用

[英]Bootstrap Datepicker positioning not working

I'm using the Bootstrap Datepicker from Eternicode on my ASP.Net MVC website. 我在ASP.Net MVC网站上使用EternicodeBootstrap Datepicker The functionality works fine but I can't properly position the datepicker modal using the orientation option as described in the docs and in the code generator available at the link. 该功能运行良好,但我无法使用docs和链接中可用的代码生成器中所述的“ orientation选项正确定位datepicker模态。 The datepicker modal covers my input control when I click into the textbox. 当我单击文本框时,日期选择器模式将覆盖我的输入控件。

HTML: HTML:

<input type="text" class="form-control datepicker input-sm" id="datepicker" />

Javascript: 使用Javascript:

$('#datepicker').datepicker({
    autoclose: true,
    format: 'dd-mm-yyyy',
    daysOfWeekDisabled: '0,6',
    todayHighlight: true,
    orientation: 'auto'
});

I've tried changing the orientation to bottom-left , bottom-right and other options to no avail. 我尝试将方向更改为bottom-leftbottom-right和其他选项均无济于事。 The modal always covers the input control. 模态始终覆盖输入控件。

Notes: 笔记:

  • I haven't overwritten any CSS for the datepicker plugin 我没有覆盖datepicker插件的任何CSS
  • Other options, eg, todayHighlight work 其他选项,例如todayHighlight

I'm sure I'm missing something stupid...please help? 我确定我缺少一些愚蠢的东西...请帮忙吗?

Had similar problem. 有类似的问题。 I used the resource js( http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js ) and css( http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker3.css ) links available in the fiddle J Santosh recommended and it worked. 我使用了资源js( http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js )和css( http://cdnjs.cloudflare.com/ajax推荐的小提琴J Santosh中提供了/libs/bootstrap-datepicker/1.3.0/css/datepicker3.css )链接,并且该链接有效。 Edit: When giving the orientation value, your code would be like this 编辑:给出方向值时,您的代码将如下所示

$('#datepicker').datepicker({
    autoclose: true,
    format: 'dd-mm-yyyy',
    daysOfWeekDisabled: '0,6',
    todayHighlight: true,
    orientation: 'bottom left'
});

The '-' should not be there: bottom left instead of bottom-left. “-”不应在此处:左下而不是左下。 Use the css and js files above if it still doesn't work. 如果仍然无法使用,请使用上面的css和js文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM