IE中的窗口拖动问题

Sha*_*wat 9 internet-explorer extjs window draggable extjs4

ExtJS 4

我希望我的Ext.Window被拖到浏览器边界之外.所以我删除了浏览器的滚动条

document.documentElement.style.overflow = 'hidden';  // firefox, chrome
document.body.scroll = "no"; // ie only
Run Code Online (Sandbox Code Playgroud)

在Firefox中它的工作正常.但是在IE中,每当我将窗口拖到外面时,它都会再次在浏览器窗口中捕捉.

I want this (case 1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                            |
|                            |
|                            |
|                            |
|                            |
|                            |
|                       --window----
|                       |  A |   B |
|                       -----+------
|                            |
|                            |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)

A =可见部分

B =裁剪部分

But this is happening in IE8 (case 2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                            |
|                            |
|                            |
|                            |
|                            |
|                            |
|                  --window--|
|                  |        ||
|                  ----------|
|                            |
|                            |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)

请告诉我为什么会这样.怎么纠正这个?

编辑:

这是我正在使用的完整代码.它在firefox中表现为案例1(这是必需的),但在IE中则作为案例2.

<html>
<head>
    <title>Page5 (Window)</title>

    <link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css"> 
    <script type="text/javascript" src="../ext-all.js"></script>
    <script type="text/javascript">

    Ext.onReady(function(){
        document.documentElement.style.overflow = 'hidden';  // firefox, chrome
        document.body.scroll = "no"; // ie only
        Ext.create('Ext.Window', {
            title: 'Title',
            html: 'html',
            height: 300,
            width: 300
            //constrainHeader: true
        }).show();
    });
    </script>
</head>
<body background="Water lilies.jpg" ></body>
</html>
Run Code Online (Sandbox Code Playgroud)

sEr*_*vIL 1

如果您的窗口位于某些 ExtJS 容器(如 Viewport 或 Panel)内,则它可以工作。请参阅下面的代码:

Ext.onReady(function() {
    document.documentElement.style.overflow = 'hidden'; // firefox, chrome
    document.body.style.overflowX = 'hidden';
    document.body.style.overflowY = 'hidden';
    //  document.body.style.position = 'relative';
    document.body.scroll = "no"; // ie only
    Ext.create('Ext.Viewport', {
        title : 'Test Panel',
        width : 1000,
        height : 700,
        items : [ {
             id : 'mywin',
             title : 'Title',
             html : 'html',
             height : 300,
             width : 300
        } ]
    });
    Ext.getCmp('mywin').show();
});
Run Code Online (Sandbox Code Playgroud)

您也可以将其包含在面板中...如果面板小于浏览器的视图,则窗口会滚动到面板之外,并且在到达浏览器边界时表现得像您想要的那样。

看看这个。我无法改变身体的位置类型并使其正常工作。也许你可以尝试一下。