【问题标题】:Change the position of UI datepicker [duplicate]更改 UI 日期选择器的位置 [重复]
【发布时间】:2011-10-26 15:02:56
【问题描述】:

可能重复:
How to change the pop-up position of the jQuery DatePicker control

如何更改 UI 日期选择器小部件的位置??

我为我的文本框使用了 ui datepicker 小部件。但是当我点击日历时。显示数据选择器。但是日期选择器停留在错误的位置。数据选择器必须位于日历图标的左侧。

你可以在这里看到它的直播:You can see it here live

这是我用于 ui 数据选择器的 javascript。

// Data picker
$(function () {
    $('#datepicker').datepicker({
        beforeShow: function(input, inst)
        {
            inst.dpDiv.css({marginTop: -input.offsetHeight + 'px', marginRight: input.offsetWidth + 'px'});
        }
    });
});

【问题讨论】:

标签: javascript jquery jquery-ui user-interface


【解决方案1】:

你可以添加这个css:

#ui-datepicker-div
{
    left:600px !important;
    width:470px !important;
}

您可以通过改变左侧和宽度(以像素为单位)来调整位置。我通过使用 Firebug 为 firefox 调试 html 发现了这一点。

【讨论】:

    猜你喜欢
    • 2018-10-16
    • 1970-01-01
    • 1970-01-01
    • 2020-01-20
    • 2016-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多