热门关键字:  PHP  Cisco  seo  网络广告 虚拟主机 中文域名
当前位置 :| 主页>网页特效>图形图象>

自由设定图片大小

来源: 作者: 时间:2005-12-31 点击:


<!-- 要实现此效果需要 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>

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
赞助商连接