簡體   English   中英

Modal ExtJS窗口不會在Safari和Chrome中掩蓋其背后的所有內容

[英]Modal ExtJS Window not masking everything behind it in Safari and Chrome

我想知道是否有人可以幫助我解決這個問題。 每次我將Ext.Window的模式配置設置為true時,在FF和IE中都可以正常工作,我的意思是彈出窗口后面的所有內容都被遮蓋了,而在Safari和Chrome中卻沒有。 當我嘗試向下滾動頁面時,我看到掩碼受到限制,這不是我想要的,因為即使在窗口尚未關閉的情況下,也可以輕松地在父頁面上執行某些操作。 有人可以幫我嗎? 提前感謝。 :D

我認為如果您不在 Viewport運行,可能會發生這種情況,因此我整理了一個簡單的示例。 事實證明,在此示例中,模態蒙版在Safari中工作得很好 嘗試一下,看看您的代碼有何不同。

<html>
  <head>
    <link rel="stylesheet" href="ext-3.1.1/resources/css/ext-all.css" />
    <script src="ext-3.1.1/adapter/ext/ext-base.js"></script>
    <script src="ext-3.1.1/ext-all-debug.js"></script>
    <script>
      Ext.BLANK_IMAGE_URL = 'ext-3.1.1/resources/images/default/s.gif';
      Ext.onReady(function(){
        var p = new Ext.Panel({
          renderTo: 'panel',
          html: 'this is the panel',
          tbar: [{
            text: 'Show a Modal Window',
            handler: function() {
              new Ext.Window({
                title: 'Title',
                html: 'Try scrolling - the entire page should be modal',
                modal: true
              }).show();
            }
          }]
        });
      });
    </script>
  </head>
  <body>
    <h1 style="height:100px;background-color:green;">html page</h1>
    <div id="panel"></div>
    <h1 style="height:1200px;background-color:green;">html page</h1>
  </body>
</html>

開箱即用的Safari和Chrome應該可以正常工作。 我剛剛在Safari 4.0.4 Mac中驗證了此頁面 ,並且可以在滾動和/或調整瀏覽器大小時正常使用。 在您的特定瀏覽器/平台上,Ext可能存在一個錯誤,但這是一種基本功能,對此我表示懷疑。 該頁面對您有用嗎?

這有助於將Ext.Msg.show()警報的z-index設置在為我打開的窗口的前面。

Ext.WindowMgr.zseed = 10000;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM