js 如何知道一个网络图片的高宽var img = new Image();
img.src = obj.src;
console.log('width:'+img.width+',height:'+img.height)
img.onload = function(){
console.log('width:'+img.width+',height:'+img.height)
};
已经找到方法了,虽然那个啥,鄙人不喜欢用jq 一切原生重写
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
图片加载完成事件中可以获得图片原始高宽