moveTo()方法格式:window.moveTo(x,y);
功能:将窗口移动到指定坐标(x,y)处;
resizeTo()方法格式:window.resizeTo(x,y);
功能:将当前窗口改变成(x,y)大小,x、y分别为宽度和高度;
resizeBy()方法格式:window.resizeBy(x,y);
功能:将当前窗口改变到指定的大小(x,y),当x、y的值大于0时为扩大,小于0时为缩小。
实现过程:
<script language=JavaScript>
var winheight,winsize,x;
function go1(){
winheight=100;
winsize=100;
x=5;
win2=window.open("abc.html","","scrollbars='no'");
win2.moveTo(0,0);
win2.resizeTo(100,100);
go2();
}
function go2(){
if (winheight>=screen.availHeight-3)
x=0;
win2.resizeBy(5,x);
winheight+=5;
winsize+=5;
if (winsize>=screen.width-5){
winheight=100;
winsize=100;
x=5;
return;
}
setTimeout("go2()",50)
}
</script>
<a href="javascript:go1()">打开明日美食留言薄</a>