ModalPopupExtender和z指数 [英] ModalPopupExtender and z-index

查看:267
本文介绍了ModalPopupExtender和z指数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能改变ASP.NETAJAX ModalPopupExtender的z-index。默认情况下为100001。
谢谢你。

How can I change ASP.NETAJAX ModalPopupExtender z-index. By default it is 100001. Thanks.

推荐答案

我使用此功能:

  function ShowModalPopup(modalPopupId, zIndex) {

    try {
      if (modalPopupId == null) throw new Error(0, 'Incorrect value of param modalPopupId!');

      var modalPopupBehavior = $find(modalPopupId);
      if (modalPopupBehavior == null) throw new Error(0, 'Not found modal popup ' + modalPopupId + '!');

      zIndex = typeof (zIndex) != 'undefined' ? zIndex : null;

      if (zIndex != null) {
        modalPopupBehavior._backgroundElement.style.zIndex = zIndex;
        modalPopupBehavior._foregroundElement.style.zIndex = zIndex + 1;
      }

      modalPopupBehavior.show();
    }
    catch (ex) {
      alert('Exception in ShowModalPopup: ' + ex.message);
    }
  }

和它的呼叫:

  ShowModalPopup('<%= modalpopup.ClientID %>', 20001);

这篇关于ModalPopupExtender和z指数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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