引导日期戳的方向/位置 [英] Bootstrap datepicker orientation/placement

查看:146
本文介绍了引导日期戳的方向/位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本字段,在页面的底部放置一个附加的日期戳。我的问题是日期选择器出现在文本字段下面。

I have a text field with an attached datepicker placed at the bottom of the page. My problem is that the datepicker appears below the text field.

因此,它出现在窗口外。我Googled并发现,显然我可以解决这个与一些方向属性:

Consequently, it appears outside the window. I Googled and found that apparently I can fix this with some orientation property:

$('#dp2').datepicker({
     orientation: 'auto top'
});

但这没有效果。

推荐答案

经过一番斗争后,发现需要的解决方案

After some struggle found the required solution

Datepicker Link ,只需点击下载开发并获取包含定向选项的最新JS。在JS中给出的默认值是:

at Datepicker Link, just click the Download Development and get latest JS which include the orientation options. In the JS given defaults are:

var defaults = $.fn.datepicker.defaults = {
    autoclose: true,
    beforeShowDay: $.noop,
    calendarWeeks: false,
    clearBtn: false,
    daysOfWeekDisabled: [],
    endDate: Infinity,
    forceParse: true,
    format: 'mm/dd/yyyy',
    keyboardNavigation: true,
    language: 'en',
    minViewMode: 0,
    orientation: "auto",
    rtl: false,
    startDate: -Infinity,
    startView: 2,
    todayBtn: false,
    todayHighlight: false,
    weekStart: 0
};

我只是使用默认值:

orientation: "auto",

这篇关于引导日期戳的方向/位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆