[英]naturalHeight and naturalWidth property new or deprecated?
naturalHeight
and naturalWidth
property of HTMLImageElement
object is not mentioned in mozilla website Link naturalHeight
object 的HTMLImageElement
和naturalWidth
属性未在 mozilla 网站链接中提及
Although both properties works fine in Firefox but i don't see this in documentation.虽然这两个属性在 Firefox 中都可以正常工作,但我在文档中看不到这一点。
Is it a deprecated property or new in HTML5?它是 HTML5 中的弃用属性还是新属性?
Can someone give me a link where these properties are defined in standard?有人可以给我一个链接,这些属性是在标准中定义的吗?
Definitely not deprecated.绝对不会弃用。 Checking the HTML5 spec for the img
element , we can see:检查img
元素的 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] IDL 属性 naturalWidth 和 naturalHeight 必须返回图像的固有宽度和高度,如果图像可用,则以 CSS 像素为单位,否则为 0。 [CSS]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.