naturalHeight
和 naturalWidth
属性在 mozilla 网站中未提及 HTMLImageElement
对象 Link
虽然这两个属性在 Firefox 中工作正常,但我没有在文档中看到这一点。
它是已弃用的属性还是 HTML5 中的新属性?
谁能给我一个链接,其中这些属性是在标准中定义的?
最佳答案
绝对不会弃用。检查 img
element 的 HTML5 规范,我们可以看到:
The IDL attributes naturalWidth and naturalHeight must return the intrinsic width and height of the image, in CSS pixels, if the image is available, or else 0. [CSS]
关于javascript - naturalHeight 和 naturalWidth 属性是新增的还是已弃用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10076031/