Closed Thread Icon

Topic awaiting preservation: getting the dimensions of an image on IE MAC (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8085" title="Pages that link to Topic awaiting preservation: getting the dimensions of an image on IE MAC (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: getting the dimensions of an image on IE MAC <span class="small">(Page 1 of 1)</span>\

 
ShadowImage
Nervous Wreck (II) Inmate

From: Melbourne, Victoria, Australia
Insane since: Mar 2001

posted posted 02-19-2002 13:41

Hi,
I have an image preload function that is called when onload event fires.
eg:
pic = new Image();
pic.onload = drawIt;
pic.src = 'anImage.jpg';

function drawIt() {
var w,h;
w = this.width;
h = this.height;
//code to resize w and h depending on the screen resolution
//code to write IMG tag to a layer
}

It works fine on my PC, NS and IE but I recently found that on MAC IE (using a cable modem) w = 1 and h = 0 which is NOT the width and height of the image. Is there a solution for this or is my code wrong? I hope my explanatino makes sense.

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 02-19-2002 15:21

you are completly right,

I see no reason for it not to work...can you try to replace the this with the image reference itself inside of drawIt()?



Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 02-19-2002 19:08

I don't currently have access to Mac IE to find the answer to this but I do remember that Mac IE was an utter piece of crap. I had lots of problems getting some of my pages to work on it. It would not surprise me if you are running up against one of its numerous bugs.

Jeni
Paranoid (IV) Mad Scientist

From: 8675309
Insane since: Jul 2000

posted posted 02-19-2002 22:05

If you post a page with the script, I'll check it in Mac IE 5.1, perhaps it was bug and has been fixed.

ShadowImage
Nervous Wreck (II) Inmate

From: Melbourne, Victoria, Australia
Insane since: Mar 2001

posted posted 02-20-2002 08:26

Could it be that it won't work if the image is in cache?
Or is the "onload" thingy for MAC IE just funky?


a link to a test page


vto
Obsessive-Compulsive (I) Inmate

From: Godella, Valencia, Spain
Insane since: Feb 2002

posted posted 02-21-2002 08:09

I'd test it for:

w98 Ie 5.1 don't works
Nt4.0 Ie 6 fine

I hope it helps you, if someone can make it work under W98 Ie 5.1 I can try to aply some changes step by step to see when it works.

Rgs,
vto


ShadowImage
Nervous Wreck (II) Inmate

From: Melbourne, Victoria, Australia
Insane since: Mar 2001

posted posted 02-21-2002 11:43

There's a w98 IE 5.1?? Thought there was a 5 and a 5.5 only .. hmmm....
Works fine on my w2k IE 5 ...can't see why it wouldn't work for newer version.
Thanks anyway vto

Put in 2 alert boxes saying dimensions


« BackwardsOnwards »

Show Forum Drop Down Menu