html5中文学习网

您的位置: 首页 > 网络编程 > ASP编程 » 正文

ASP控制图片显示的大小的例子_ASP教程_编程技术

[ ] 已经帮助:人解决问题
控制|显示

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language="JavaScript">
<!--
var flag=false;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 164/112){
if(image.width>164){
ImgD.width=164;
ImgD.height=(image.height*164)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"x"+image.height;
}
else{
if(image.height>112){
ImgD.height=112;
ImgD.width=(image.width*112)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"x"+image.height;
}
}
}
//-->
</script>
</HEAD>
<BODY>
<a href="http://www.webjx.com/htmldata/2006-04-27/img.jpg" target="_blank"><img src="http://www.webjx.com/htmldata/2006-04-27/img.jpg" border="0" width="164" height="112" ></a>
</BODY>
</HTML>

ZsTHTML5中文学习网 - HTML5先行者学习网
ZsTHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助