Click to See Complete Forum and Search --> : auto resizing images


Richei
11-29-2002, 08:28 PM
this one eludes me at the moment. I'm building a site that has images on it. the menu images resize just fine but there are 3 pics that are 200x200, h spaced 5 pixels apart. Now when i switch between the max view and the small view (middle button on the top of the window), those images aren't being resized. I was wondering if there was a way to resize them when the window is resized. I had one script but i lost it and don't know what site it was off of.

I can use the layers but the positioning would change so i don't know how to tell it to stay in x area.

Paco Zarabozo
11-30-2002, 04:07 AM
You can use something like this:

_____________________________________________
<html>

<img src="x.gif" border="0" name="myimg">

<script>
document.images['myimg'].width="500";
document.images['myimg'].height="50";
document.images['myimg'].border="50";
document.images['myimg'].hspace="5";
</script>

<html>
_____________________________________________

You can specify, as you can see, any property. If you specify in the script part only width (not height), the image changes its size proporcionally.

Hope this helps.

Paco.

Richei
11-30-2002, 09:08 AM
i'm printing it out now. I'll give it a try and let you know if it works.

It sort of works. The resizing isn't correct when i change the size of the window.

I have the page up on the web if you care to take a look. http://www.stopandpop.com/index4.html . maybe i'm just doing something wrong. :)

thanks.