R
RK
Is there an image handling guru out there than can help a newbie with
understanding dynamic image creation?
The question: I can create an image from within Javascript with
MyPic = new Image()
....and then assign a source with
MyPic.src = "./picture.gif";
Before doing that, I set up
MyPic.onload { do_something };
MyPic.name = 'applepie';
So that I am not jumping the gun on using that image.
I'm trying to understand how creating an image with:
AnotherImage = document.createElement('img');
AnotherImage.setAttribute('src', './picture.gif');
AnotherImage.setAttribute('name', 'applepie');
Is there an equivalent delay in loading the image? Is there an onLoad
mechanism for that "AnotherImage"?
It appears I can insert a css rule that will affect positioning of the
AnotherImage, but the same approach for MyPic doesn't work.
#applepie{position: absolute; top: 100px; left: 100px;}
Any guidance here is appreciated...
Ross.
understanding dynamic image creation?
The question: I can create an image from within Javascript with
MyPic = new Image()
....and then assign a source with
MyPic.src = "./picture.gif";
Before doing that, I set up
MyPic.onload { do_something };
MyPic.name = 'applepie';
So that I am not jumping the gun on using that image.
I'm trying to understand how creating an image with:
AnotherImage = document.createElement('img');
AnotherImage.setAttribute('src', './picture.gif');
AnotherImage.setAttribute('name', 'applepie');
Is there an equivalent delay in loading the image? Is there an onLoad
mechanism for that "AnotherImage"?
It appears I can insert a css rule that will affect positioning of the
AnotherImage, but the same approach for MyPic doesn't work.
#applepie{position: absolute; top: 100px; left: 100px;}
Any guidance here is appreciated...
Ross.