如何在表格中自动调整图片显示尺寸
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>
<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>
相关文章推荐
- ios图片缩放,根据UIImageView Frame的尺寸,自动调整UIImage缩放,保证图片显示不变形
- 一个表格,如何让他显示10秒后自动消失
- Android学习笔记:如何高效显示图片,避免内存溢出 和 ImageView无法显示大尺寸的图片
- 以图片的中心为基准,按照任意尺寸自动调整大小并截取出规定的素材,保存为缩略图或以php形式输出为图片
- Qt学习笔记之图片显示(自动调整大小适应设计的范围)
- 如何使图片尺寸自动适应窗口,随窗口大小变化而变化
- oracle vm virtualBox共享文件夹功能,也能解决自动调整显示尺寸问题
- java 添加背景图片(可根据窗口大小自动调整显示图片)
- JS防止变形自动调整图片尺寸
- PHP图片自动裁切应付不同尺寸的显示
- VirtualBox“切换到无缝模式”和“自动调整显示尺寸”菜单无法使用
- PHP图片自动裁切应付不同尺寸的显示
- 如何给wordpress首页自动显示文章内容的第一个图片
- Android如何先显示一张图片,延时几秒后,再自动跳转到另一个页
- 如何在ASP.NET页面中自动生成并显示透明的GIF图片
- EXCEL如何设置,使表格能自动调整列宽以适应文字长度
- C#里如何让尺寸太大的图片自动缩小?
- VirtualBox“切换到无缝模式”和“自动调整显示尺寸”菜单无法使能
- DotNetBar之SupergridControl显示图片,行距自动调整
- Dorado页面中点击表格中的记录时当前行自动调整行高,换行显示隐藏的信息