Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Image()

这篇翻译不完整。请帮忙从英语翻译这篇文章

Image 元素构造器

接受两个可选的参数: Image([unsigned long width, unsigned long height])

document.createElement('img')一样,返回一个 HTMLImageElement 实例.

例如:

var myImage = new Image(100, 200);
myImage.src = 'picture.jpg';
console.log(myImage);
结果:
<img width="100" height="200" src="picture.jpg">
Specification Status Comment
HTML5
The definition of the Image constructor in that specification.
Recommendation A constructor (with 2 optional parameters) has been added.
The following properties are now obsolete: name, border, align, hspace, vspace, and longdesc.
The following properties are now unsigned long, instead of long: height, and width.
The following properties have been added: crossorigin,
 

文档标签和贡献者

 此页面的贡献者: yuduxyz
 最后编辑者: yuduxyz,