let img = 'http://xunfuli.oss-cn-hangzhou.aliyuncs.com/1688527061147book1.png'
let imgObj = new Image()
imgObj.src=img
console.log(imgObj.width) //1200
console.log(imgObj.height) //1200
image.png
image.png
let img = 'http://xunfuli.oss-cn-hangzhou.aliyuncs.com/1688527061147book1.png'
let imgObj = new Image()
imgObj.src=img
console.log(imgObj.width) //1200
console.log(imgObj.height) //1200
image.png
image.png
本文标题:js 图片链接获取图片的宽高
本文链接:https://www.haomeiwen.com/subject/jzfhudtx.html
网友评论