Closed Thread Icon

Preserved Topic: Is it posible to adjust the Height Pages that link to <a href="https://ozoneasylum.com/backlink?for=7824" title="Pages that link to Preserved Topic: Is it posible to adjust the Height" rel="nofollow" >Preserved Topic: Is it posible to adjust the Height\

 
Author Thread
Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 08-27-2001 16:18

I want my script to adjust the height of a picture is it posible?
somthing like this: document.all.The_picture.style.pixelWidth += 10; ?



mobrul
Bipolar (III) Inmate

From:
Insane since: Aug 2000

posted posted 08-27-2001 17:50

Yeah, you can adjust the size of your picture with script...
but be careful. Most of the time that makes your picture look like crap.
If it was a quick shrink or grow 'animation' then it might work but if you just want to display the picture, it PROBABLY won't work. Test carefully first.

mobrul

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-27-2001 19:25

Osaires, you can do this in two ways. Using document.images or DOM...

1. document.images method

You image needs to have NAME parameter defined. And then you can use this to resize it:

document.images['picName'].width = newWidth;
document.images['picName'].height = newHeight;

2. DOM method

Your image needs to have ID parameter defined. And then you can use this to resize it:

document.getElementById('picId').setAttribute("width", newWidth);
document.getElementById('picId').setAttribute("height", newHeight);

That's all.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 08-27-2001 19:43

I believe you can only dynamically adjust the dimensions of the images in NN6+ and IE4+. Netscape 4.x would require a rewriting of the img tag with a document.write or reloading of a page.

Also, I don't know if the latest release of Mozilla still has a problem with resizing images. It is supposed to work and I'm sure it will in future releases but it was reloading the images everytime an adjustment was made.

« BackwardsOnwards »

Show Forum Drop Down Menu