Click to See Complete Forum and Search --> : Continuously Variable-Size Photograph


rwon
11-20-2008, 05:27 AM
I have seen a photograph on a website which can be resized as the window size is changed by dragging the window right bottom corner.

See Example at...
http://pl.sg/image?id1=022770d5-c689-418f-b2ec-ed877bb80841&id2=29&id3=3

Anyone has any tips on how to do this? Does it use Javascript?

Thanks.

Yelgnidroc
11-20-2008, 08:34 AM
Not sure how they have done it, but the following works for me:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>


<head>
<title></title>

<style type="text/css">
#pic
{
width:99%;
}


img
{
width:99%; /* MUST BE SET so that image re-sizes - see div#pic */
/* don't define the height, otherwise the image can sometime stretch and sometimes compress on certain browsers */
}
</style>

</head>



<body>
<div id="pic">
<img src="images/image1.jpg" />
</div>
</body>





</html>

infinityspiral
12-04-2008, 10:11 AM
It's actually not using a special script or anything, it's just an image. A BIG image. A lot of browsers resize these graphics by default so they fit on the page and that's what's happening in this case. If you're in explorer and go to tools>internet options>advanced>multimedia> and uncheck automatic image resizing