<!-- 要实现此效果需要 2 个步骤: -->
<!-- 第 1 步: -->
<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function ViewImage(form) {
ix = form.width.value;
iy = form.height.value;
ifile = form.url.value;
var win;
win = window.open("","","width="+ix+",height="+iy+",menubar=no,toolbar=no,top=100,left=100");
win.document.open();
win.document.write("<html><head></head><body>");
win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
win.document.write("<img src="+ifile+" width=" + ix + " height=" + iy + "></div></body></html>");
win.document.close();
}
// End -->
</script>
<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->
<form name=imageform>
<input name=url type=file size=40>
<p>
Height: <input name=height type=text value="200" size=3>
Width: <input name=width type=text value="150" size=3>
<p>
<input type=button value="View Image" onClick="ViewImage(this.form);">
</form>