[英]Is there a maximum dialogHeight and dialogWidth for a showModalDialog in IE8?
[英]showModalDialog - IE11 ignores dialogHeight and dialogWidth
我在IE11
上遇到showModalDialog
問題。 對話窗口工作正常,但忽略了寬度和高度參數。 該對話框在一個非常小的窗口中打開,用戶需要調整它的大小。
我知道 Chrome 中不推薦使用此功能,並且我知道其他選項,例如 jQuery-UI 對話框,但我想知道是否可以使用showModalDialog
為 IE11 解決此問題。
js代碼:
var url = "/xxWar/xxModal.jsp?title=xx&frameUrl=/xxWar/xxServlet%3Faction%3Dxx";
var value = showModalDialog(url, init, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;resizable:yes;status:no;scroll:yes;help:no");
和 xxModal.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><%=request.getParameter("title")%></title>
</head>
<frameset rows="0,*" frameborder="no" border="0" framespacing="0">
<frame src="" name="header">
<frame src="<%=request.getParameter("frameUrl")%>" name="main" id="main">
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
謝謝!
我解決了在 de modal.jsp 中添加這一行<meta http-equiv="X-UA-Compatible" content="IE=7">
問題:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=7">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><%=request.getParameter("title")%></title>
</head>
<frameset rows="0,*" frameborder="no" border="0" framespacing="0">
<frame src="" name="header">
<frame src="<%=request.getParameter("frameUrl")%>" name="main" id="main">
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
<meta http-equiv="X-UA-Compatible" content="IE=7">
你不需要回到 IE7,設置content="IE=9"
也可以 - 這就是我們使用的,我們根據需要設置高度和寬度;)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.