本文實例講述了JavaScript動態修改彈出窗口大小的方法。分享給大家供大家參考。具體如下:
下面的JS代碼演示了如何通過window.open彈出一個新的窗口,然后動態修改窗口大小
<!DOCTYPE html><html><head><script>var w;function openwindow(){w=window.open('','', 'width=100,height=100');w.focus();}function myFunction(){w.resizeTo(500,500);w.focus();}</script></head><body><button onclick="openwindow()">Create window</button><button onclick="myFunction()">Resize window</button></body></html>
希望本文所述對大家的javascript程序設計有所幫助。
新聞熱點
疑難解答