簡體   English   中英

showModalDialog()在IE11瀏覽器中無法按預期工作

[英]showModalDialog() not working as expected in IE11 browser

我正在嘗試使用window.showModalDailog()方法創建一個可變大小的POP UP。 但是它總是打開默認的小尺寸窗口。

<html>
<body>
<a href="#" onclick="javascript:void window.showModalDialog('http://www.google.com','width=950,height=950,toolbar=0,menubar=0,location=0,status=1,scrollbars=0,resizable=0,left=0,top=0');return false;">Pop-up Window</a>
</body>
</html>

問題:上面的代碼每次在IE11中打開默認的小尺寸窗口時,都不會打開大小為(950 * 950)的窗口。

showModalDialog很可能很快就會被棄用(請參見http://dev.opera.com/articles/showmodaldialog/ ),因此我建議不要使用它。

只需使用絕對定位的div來顯示您的HTML內容,或實現jQueryUI對話框以易於使用: http : //jqueryui.com/dialog/

您正在使用window.open()的參數...
window.open(' http://www.google.com','width = 950,height = 950,scrollbars = 0')

但是showModalDialog具有不同的參數,並且用冒號代替等於:window.showModalDialog(' http : //www.google.com','popWin','dialogHeight :950,dialogWidth:950,scroll:no')

暫無
暫無

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

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