自动缩略图
来源:互联网 发布:通用数据库客户端工具 编辑:程序博客网 时间:2024/05/16 01:43
<img src="wy_admin/<%=rs1("pic1")%>" width="220" height="150" border="0" ONLOAD='javascript:DrawImage(this);'>
必须要给初始文件大小
<script>
var flag=false;
function DrawImage(ImgD){
var image=new Image();
var FitWidth=220;//图片的最大宽,超过这个值就会自动缩小
var FitHeight=150;//按比例缩小
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= FitWidth/FitHeight){
if(image.width>FitWidth){
ImgD.width=FitWidth;
ImgD.height=(image.height*FitWidth)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt="";
}
else{
if(image.height>FitHeight){
ImgD.height=FitHeight;
ImgD.width=(image.width*FitHeight)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt="";
}
}
}
</script>
- 自动缩略图
- 自动批量生成缩略图
- js自动生成缩略图
- 自动缩略图JS
- C#自动生成缩略图
- 系统自动生成缩略图
- 上传图片自动保存缩略图
- powerpoint中的自动缩略图效果
- 自动生成缩略图 (文档类别:JavaScript)
- 图片上传,并自动生成缩略图!
- 用JavaScript自动生成等比例缩略图
- c#自动生成网页缩略图的方法
- php 根据url自动生成缩略图
- Wordpress 无插件实现自动显示缩略图
- phpcms 最新版本缩略图 不自动裁剪
- dedecms5.7 不能自动提取缩略图 解决方案
- wordpress用七牛云存储自动获取缩略图
- 自动生成图片缩略图的JS代码
- 日期函数
- spring bean的配置
- java多线程设计模式
- IFRAME的背景透明
- h:outputText输出HTML标签
- 自动缩略图
- 什么是vml - chenyq2008的专栏 - CSDNBlog
- 在FirFox下正常而在IE下不显示的问题
- 取字符串
- 加解密
- CMMI的22个关键过程域
- seam 的一个层次关系图
- 最大化/最小化/关闭窗口代码集锦
- 双击打不开硬盘