var image = new Image();
image.src = '图片的路径';
image.onreadystatechange=function(){
if (image.readyState=="complete") {
// alert(["图片大小是:",image.width,image.height]);
document.getElementById("ss").style.width=image.width;
document.getElementById("ss").style.height=image.height;
}
}js获取图片的宽度和高度
与本文相关的文章
网友最新评论 (0)
暂无评论