3

我想修复2 层后面的z-indexJQuery Timepicker 。到目前为止,我尝试通过将 z-index 更改为like 来修复它:modalPopupExtender.ui-timepicker-div100002

.ui-timepicker-div
{
    z-index:100002;
}

但仍然没有运气。有关解决此问题的可能方法的任何建议?它可以是 jQuery 本地化或纯 css 编码。

谢谢你。

4

2 回答 2

2

尤里卡!我终于设法通过以下场景的组合调整来解决这个问题:

  1. 2-Layer modalPopupExtender 正在回发。这意味着之前的 jQuery localize 已经消失了。要解决此问题, $(document).ready(function() {});您必须function pageLoad(){}像这样使用,而不是 :

    function pageLoad()
    {
       $('#ctl00_ContentPlaceHolder1_txtTimeSlotFrom').timepicker({
            hourGrid: 4,
            minuteGrid: 10
       });
    }
    
  2. 现在,要修复z-index,我beforeShow在本地化中包含配置,如下所示:

            $('#ctl00_ContentPlaceHolder1_txtTimeSlotFrom').timepicker({
                hourGrid: 4,
                minuteGrid: 10,
                beforeShow: function() {
                    setTimeout(function(){
                        $('.ui-timepicker').css('z-index', 16777271);
                    }, 0);
                }
            });
    
于 2013-07-09T09:42:38.563 回答
1

尝试这个

.ui-timepicker  //on .ui-datepicker because it gives z-index to this div at runtime and add position:absolute;
{
    z-index:100002 !important;
    position:absolute;
}
于 2013-07-09T09:42:26.100 回答