(一).示例图片效果
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/)
(二).代码
html
head
titlewindow.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=lightgreenfont 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