<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function funmoveby() {
window.moveBy(-10, -10);
}
function funmoveto() {
window.moveTo(10, 10);
}
function funresizeby() {
window.resizeBy(20, 20);
}
//setInterval(funresizeby, 500);
function funresizeto() {
window.resizeTo(20, 20);
}
function fungetscreenleft() {
alert(window.screenLeft);
}
function fungetscreenwidth() {
alert(window.screen.width + "*" + window.screen.height);
}
var newwindow
function funwindowopen() {
newwindow = window.open('HTMLPage1.htm', '', 'left=100px,top=100px,width=500px,height=500px,resizable=no,scrollable=yes,toolbar=yes,status=yes,location=yes');
}
function funnewwindowlocation() {
newwindow.location = 'http://www.baidu.com';
}
function funclosenewwindow() {
newwindow.close();
}
function funmovetonewwindow() {
newwindow.moveTo(100, 100);
}
function forward() {
window.history.go(1);
}
function back() {
window.history.go(-1);
}
</script>
</head>
<body>
<input id="Button11" type="button" value="前进" οnclick="forward();" /><br />
<input id="Button12" type="button" value="后退" οnclick="back();" /><br />
<a href="HTMLPage3.htm">跳转到page3</a>
<input id="Button1" type="button" value="移动浏览器" οnclick="funmoveby();" />
<br />
<input id="Button2" type="button" value="移动浏览器到" οnclick="funmoveto();" />
<br />
<input id="Button3" type="button" value="调整浏览器大小" οnclick="funresizeby();" />
<br />
<input id="Button4" type="button" value="调整浏览器大小到" οnclick="funresizeto();" />
<br />
<input id="Button5" type="button" value="获取相对于浏览器左边缘的距离" οnclick="fungetscreenleft();" />
<br />
<input id="Button6" type="button" value="获取屏幕的宽和高" οnclick="fungetscreenwidth();" />
<br />
<input id="Button7" type="button" value="打开新窗体" οnclick="funwindowopen();" />
<br />
<input id="Button8" type="button" value="新窗体跳转到百度" οnclick="funnewwindowlocation();" />
<br />
<input id="Button9" type="button" value="关闭新打开的窗口" οnclick="funclosenewwindow();" />
<br />
<input id="Button10" type="button" value="调整新窗口的大小" οnclick="funmovetonewwindow();" />
</body>
</html>