-
image size
hi i have some link on my page
when some one click the the links
i want to get 1st the image on server then the window open
with the image size....
i wrote this code but it's work some time ....
function getwin(msrc)
{
var mm = new image()
mm.src = msrc
imgh = mm.height
imgw = mm.width
window.open('test1.htm?src='+msrc,'_blank','height='+imgh+',width='+imgw+',top=0,left=100')
}
can some help plz
thanks
-
not sure, but maybe u need to wait till the mm object is fully loaded from the server before reading its dimensions,
like:
while (mm.readyState!='complete') wend
not sure, coz i'm not too good in java, but it should be something like this. u can avoid a deadlock by specifying a time out or some other condition...
-
Thanks about the tip....
but is it possible to know that the image has been download completely.
-
yes, that's what i was saying,
when the image is loaded completely, it's state would be 'complete':
img.readyState=='complete'
check the msdn for the img object properties:
http://msdn.microsoft.com/library/default.asp
-