开发者

Create an Image object from scratch? (Javascript)

开发者 https://www.devze.com 2023-03-24 07:51 出处:网络
I want to create an image object from scratch. Here is the idea: var image = new Image(); var image2 = new Object();

I want to create an image object from scratch. Here is the idea:

var image = new Image();
var image2 = new Object();
/* heres where the magic is
\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
if image = image2
    alert('sucess');

The goal is that I need to edit the Image object to accept video files. I suppose the solution could also be开发者_如何学JAVA prototypical if it changed the structure of the Image object appropriately.


function videotr(){
media = document.createElement('video');
media.preload = true;
//media.controls = true;
media.className = 'c1';
media.id = 'it'; 
document.getElementById('crop').appendChild(media);
//media.loop = true;
//media.autoplay = true;


return media;

}

this works

0

精彩评论

暂无评论...
验证码 换一张
取 消