Email conversation
From | KJ |
To | Me |
Subject | mozilla problem |
Date | 30 April 2004 14:55 |
Hi again [referring to some earlier fanmail :) ],
I have used your script for perfect popups and it works perfectly in IE6,
but fails miserably in Mozilla. I have both a picture and a description
underneath it. see attached page. I have tried everything but Mozilla
doesn't seem to load the picture in or does not somehow recognize it early
enough. have tried to reload the picture again, but not much luck . Have
worked on this problem for a solid 12 hrs now and still cant get it to work.
if you have any suggestions they would be very welcome.
K.J
From | Me |
To | KJ |
Subject | Re: mozilla problem |
Date | 1 May 2004 10:45 |
The problem is quite simple. You are asking the browser to write the popup
page, and then expecting it to know how big the image is before it has
loaded. The simple solution is to put in the height and width attibutes of
the image. That way the browser will know how big to make the div
containing the image even before the image has loaded:
for example:
function picmaker(name,width,height,description,ticked)
{ this.name=name; this.width=width; this.height=height;
this.description=description; this.ticked=ticked; }
...
statues[0]=new picmaker("Agni",200,100,"Agni is the god of fire",false);
...
img='<img src="images/'+outpic[t].name+'.jpg" alt="" '+
'width="'+outpic[t].width+'" height="'+outpic[t].height+'">';
It means a bit of extra work for you, but it is the only way do get a clean
result (there are other ways to do this using preloading of the image, but
that is starting to get very messy).