Window resizeBy() 方法

定义和用法

resizeBy() 方法用于根据指定的像素来调整窗口的大小。

注意: 此方法定义指定窗口的右下角角落移动的像素,左上角将不会被移动(它停留在其原来的坐标).

语法

resizeBy( width,height)
参数 描述
width 必需。要使窗口宽度增加的像素数。可以是正、负数值。
height 可选。要使窗口高度增加的像素数。可以是正、负数值。

实例

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="gb2312">
  5. <title>调整窗口</title>
  6. <script>
  7. function resizeWindow(){
  8. top.resizeBy(100,100);
  9. }
  10. </script>
  11. </head>
  12. <body>
  13. <form>
  14. <input type="button" onclick="resizeWindow()" value="调整窗口">
  15. </form>
  16. <p>调整窗口</p>
  17. </body>
  18. </html>

运行效果



 

猜你喜欢

转载自cakin24.iteye.com/blog/2357779