0

Desired behavior:

  • popup1 is 100x100
  • popup2 is 50x50
  • neither popup can be modal for my purposes.

When popup1 is shown popup2 should also be shown in front of it. I want popup2 to always be in front of popup1 but when I click on popup1 then popup2 is always moved behind popup1. When I say "in front" I mean that I want popup2 to always have a higher z-index (foremost) even when popup1 is the active popup.

Attempts and info:

I can see in the page markup that a single popup gets a z-index of 12000 by default.

I have tried using css to give each popup different z-index values like so:

.popup1{z-index:20000!important;}
.popup2{z-index:21000!important;}

I also tried it like this:

.popup1{z-index:11000!important;}
.popup2{z-index:12001!important;}

I also tried wrapping each popup in a div tag with similar css.

Each popups z-index is updated to 12002 depending on whether or not it is active or not and this is regardless of what I set it to.

I also tried wrapping the larger popup in a div tag and handling the onclick event to set the z-index of the smaller popup.

Thanks in advance!

Some semi-related links:

http://www.devexpress.com/Support/Center/p/Q346044.aspx

http://www.devexpress.com/Support/Center/p/Q382392.aspx

http://www.devexpress.com/Support/Center/p/Q36091.aspx

4

2 回答 2

0

以前,我尝试将 popup1(后)包装在处理 onclick 事件的 div 中,以将 popup2(前)带到前面,但这不起作用。

起作用的是处理 div 包装器的 onmousedown 事件。

于 2013-05-14T16:36:36.640 回答
0

您可以在 popup1 Shown事件中调用 popup2 BringToFront方法。

<dxpc:ASPxPopupControl ClientInstanceName="popup1"...>
    <ClientSideEvents Shown="
        function(s, e) { 
            if(e.window.index == 0) popup1.BringWindowToFront(popup1.GetWindow(1))
        }"/>
</dxpc:ASPxPopupControl>

此示例使用一个包含两个窗口的弹出控件。如果这不是您的情况(也许您有两个带有一个窗口的弹出控件),只需根据您的需要调整示例。

于 2013-05-14T09:11:31.090 回答