将 jQuery .dialog() 和 .datepicker() 与 z-index 一起使用

发布于 2025-01-06 21:20:27 字数 529 浏览 3 评论 0原文

尝试在 .dialog() 中加载 .datepicker()

我正在这样做,但它似乎根本没有出现在对话框中:

 $(document).ready(function(){
    $("#ui-datepicker-div").css("z-index","9999 !important");

    // tried this too
    $(".ui-datepicker").css("z-index","9999 !important");
 });

FireBug 说它仍然是

这里出了什么问题?我在没有帮助的情况下查看了这个: Trouble with jQuery Dialog and Datepicker plugins

Trying to load .datepicker() inside a .dialog()

I'm doing this, but it doesn't seem to come up at all in the dialog:

 $(document).ready(function(){
    $("#ui-datepicker-div").css("z-index","9999 !important");

    // tried this too
    $(".ui-datepicker").css("z-index","9999 !important");
 });

FireBug says it's still <div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="position: absolute; top: 339.4px; left: 656.4px; z-index: 2; display: block;"> when loaded.

Whats wrong here? I looked at this with no help: Trouble with jQuery Dialog and Datepicker plugins

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

困倦 2025-01-13 21:20:27

控制台日志 $('#ui-datepicker-div').length 它可能不在运行时的 dom 中。

如果返回 0,那么您需要将该代码适当地移动到它存在于 dom 中之后。

console log $('#ui-datepicker-div').length it's possible it's not in the dom at the point that's run.

If that returns 0, then you'll need to move that code appropriately to after it exists in the dom.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文