IE8窗口大小问题

时间:2011-04-12 06:14:05

标签: javascript

我正在使用这个javascript代码:

function openQueryWindow(val)
{
    var wName       = "....";
    var srcHeight = screen.Height - 100;
    var srcWeight = screen.width  - 100;
    var dLeft = 50
    var dTop=25 
    var sFile=".....";
    window.open(sFile,wName,"scrollbars=1,location=0,status=0,menubar=0,toolbar=0,directories=0,resizable=0,width=" + srcWeight + ",height=" + srcHeight + ",top="+dTop+",left="+dLeft+",alwaysRaised") 
}

此代码在IE7的弹出窗口中有效,但在IE8中不起作用,弹出窗口似乎无法控制!怎么解决这个问题?

1 个答案:

答案 0 :(得分:2)

您可以强制IE8呈现HTML,因为IE7会... 将其添加到尽可能接近开始标记的位置

<meta http-equiv="X-UA-Compatible" content="IE=7" />

here full article