『 更新时间:2008-06-21 』『 字体:大 中 小 』『 作者:佚名 | 来源:本站原创 』
<!--如何让图片强制缩小后不会失真,最新解决方法-->
<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>= 105/80){
if(image.width>105){
ImgD.width=105;
ImgD.height=(image.height*105)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt="点击查看详细信息...";
}
else{
if(image.height>80){
ImgD.height=80;
ImgD.width=(image.width*80)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt="点击查看详细信息...";
}
}
}
//-->
</script>
<TD width="105" height="85" align="center" bgcolor="#E9E9E9">
<a href='ProductShow.asp?ID=104' target=_blank title='除异味系列'>
<img src="UploadFiles/2006112016052254.jpg" alt="除异味系列" width="105" height="80" border="0" onload="javascript:DrawImage(this);">
</a>
</TD>
将以上的代码放在你的网页上试试吧
可能是你想要的哦
Power by DedeCms CopyRight 2006-2008 www.68start.com All Rights Reserved 起点设计资源网
本站部分文章来自于网络,如有侵犯您的权益请与我们联系,本站将第一时间纠正