js兼容火狐获取图片宽和高的方法
2016-07-05 22:41
573 查看
这篇文章主要介绍了js兼容火狐获取图片宽和高的方法,涉及javascript图片操作的相关技巧,需要的朋友可以参考下
本文实例讲述了js兼容火狐获取图片宽和高的方法。分享给大家供大家参考。具体实现方法如下:
"idcardfile"
"img"
本文实例讲述了js兼容火狐获取图片宽和高的方法。分享给大家供大家参考。具体实现方法如下:
"text/html; charset=GBK"
http-equiv=
"Content-Type"
/>
function
newimage(obj) {
a =
new
Image();
var
objectURL = window.URL.createObjectURL(obj.files[0]);
var
img= document.getElementByIdx_x_x(
'img'
)
img.src = objectURL;
a.src = objectURL;
img.onload=
function
(){
alert(img.width);
alert(img.height);
}
}
"idcardfile"
type=
"file"
name=
"idcardfile"
onchange=
"newimage(this)"
/>
"img"
style=
"display: none;"
>
希望本文所述对大家的javascript程序设计有所帮助。 原博文地址:http://www.jb51.net/article/66465.htm
相关文章推荐
- JavaScript对象字面量
- js之浏览器对象模型(BOM)
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- JavaScript charAt() 方法
- 执行环境、作用域链
- KindEditor + Jsp 使用总结之KindEditor4.1.10编辑器图片上传(2)
- JSON详解
- 利用js 判断浏览器类型