首页 > Windows开发 > 详细

js之window

时间:2020-03-28 18:19:35      阅读:50      评论:0      收藏:0      [点我收藏+]

1.获得窗口的位置

 var left = window.screenLeft || window.screenX;
 var top = window.screenTop || window.screenY;

2.获得窗口的大小

 var width = document.documentElement.clientWidth || document.body.clientWidth;
 var height = document.documentElement.clientHeight || document.body.clientHeight;

3.窗口的打开和关闭

   var window1 = window.open("http://www.baidu.com",
            "_blank",
            "height=400,width=400,top=10,left=10,resizable=yes");
        window1.close();

4. 超时调用 setTimeOut(fn,500)

5.间隔调用 setInterval(fn,500)

清除间隔调用

int timer = setInterval(fn,500);

clearInterVal(timer);rrrr5f

6.系统对话框

alert(‘hello world!‘);

confirm(‘Are you sure?‘);  确认框

prompt(‘Are you sure?‘,‘Michael‘); 提示框

 

js之window

原文:https://www.cnblogs.com/xiaoxinstart/p/12588301.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!