您的位置:首页 > 其它

如何在表格中自动调整图片显示尺寸

2010-04-09 16:30 651 查看
其实,你可以使用javascript来设置的哦,也不难。
<td><img src="xxx.jpg" name=thumb_1 name=thumb_1 width=0></td>;

<script language="javascript">;

var thumb_Max_Width=100;

var thumb_Max_Height=100;

var thumb_scale=1;

/*document.all.thumb_1.width=var thumb_Max_Width;*/

if (document.all.thumb_1.height>thumb_Max_Height)

{

thumb_scale = document.all.thumb_1.height/thumb_Max_Height;

document.all.thumb_1.height=thumb_Max_Height;

document.all.thumb_1.width=thumb_Max_width/thumb_scale;

}

</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐