KJ

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromKJ
ToMe
Subjectmozilla problem
Date30 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
FromMe
ToKJ
SubjectRe: mozilla problem
Date1 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).
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.