js基础:window.resizeBy()方法使用示例
2010-09-14 13:34:18 来源:WEB开发网(一).示例图片效果
(二).代码
<html>
<head>
<title>window.resizeBy()函数</title>
<script laguage="javascript">
<!--
function resizewin(dir,dist)
{
var winvert;
var winhorz;
if (dir == "vert"){
winhorz=0;
winvert=dist;
}
else{
winvert=0;
winhorz=dist;
}
window.resizeBy(winhorz,winvert);
}
//-->
</script>
</head>
<body bgcolor="#6699FF" text="#000000">
<form>
<table border=0 align=center width="285">
<tr>
<td colspan=4 align=center bgcolor=lightgreen><font color=blue size=3>点击按钮操作</font></td>
</tr>
<tr>
<td>
<input type=button value="纵向加" onclick=resizewin("vert",10) style="background-color:lightblue;">
</td>
<td>
<input type=button value="纵向减" onclick=resizewin("vert",-10) style="background-color:lightblue;">
</td>
<td>
<input type=button value="水平加" onclick=resizewin("horz",10) style="background-color:lightblue;">
</td>
<td>
<input type=button value="水平减" onclick=resizewin("horz",-10) style="background-color:lightblue;">
</td>
</tr>
</table>
</form>
</body>
</html>
更多精彩
赞助商链接