经过window.open()会返回一个新窗口的引用,能够通resizeTo(x,y)和moveTo(x,y)来调整窗口大小和移动。 具体用法以下:bash
var wrox=window.open("www.baidu.com","topFrame","height=400,width=400,top=400,left=10,resizable=yes");
wrox.resizeTo(2000,500);
wrox.moveTo(100,100);
复制代码
新建立的新窗口的引用window对象有另一个opener属性,这个属性保存着打开它的原始窗口对象,也就是调用window.open的窗口或者框架.框架
在ie8和Chrome中会把opener属性设置为null,来切断新旧标签页的通讯ui
顾名思义就是咱们平时用的定时器.spa
调用两个方法后会返回两个id,表示超时调用和间歇调用的对象,经过该对象能够中止超时和间歇的定时器code
//设置超时调用
var timeoutid = setTimeout(function(){
alert("hello world");
},1000);
//取消超时调用
clearTimeout(timeoutid);
复制代码
//设置间歇调用
var intervalid = setTimeout(function(){
alert("hello world");
},1000);
//取消间歇调用
clearInterval(intervalid);
复制代码