Hey all,
I've found a solution to my problem using a different method but I still don't understand why my method didn't work.
I wanted to open a popup window to display a large image (when the thumbnail is clicked) and I wanted the size of the window to be relative to the size of the picture.
The alert below always returns 20 irregardless of the size of the image. Any ideas as to why the true width is not returned?
I've found a solution to my problem using a different method but I still don't understand why my method didn't work.
I wanted to open a popup window to display a large image (when the thumbnail is clicked) and I wanted the size of the window to be relative to the size of the picture.
The alert below always returns 20 irregardless of the size of the image. Any ideas as to why the true width is not returned?
Code:
var popImg = new Image();
popImg.src = imgURL;
alert(popImg.width);
doPopup2(imgURL, popImg.width+10, popImg.height+10);