【问题标题】:Using jQuery .dialog() and .datepicker() with z-index使用带有 z-index 的 jQuery .dialog() 和 .datepicker()
【发布时间】:2012-02-16 18:00:08
【问题描述】:

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

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

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

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

FireBug 说加载时它仍然是 <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;">

这里有什么问题吗?我毫无帮助地看着这个:Trouble with jQuery Dialog and Datepicker plugins

【问题讨论】:

  • 日期选择器和对话框 div 是否定位? z-index 仅适用于定位元素(位置:绝对、位置:相对或位置:固定)
  • 对象已经是absolute 见上面的更新

标签: jquery jquery-ui-dialog jquery-ui-datepicker


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-17
    • 1970-01-01
    • 2017-06-03
    • 2012-04-05
    • 1970-01-01
    • 2012-08-18
    • 2012-05-07
    • 1970-01-01
    相关资源
    最近更新 更多