[thelist] JS: Resizing an image?

Kowalkowski, Lee (ASPIRE) lee.kowalkowski at hmrcaspire.com
Fri Aug 26 04:05:05 CDT 2005


> -----Original Message-----
> From: Frank [mailto:lists at frankmarion.com]
> Sent: Thursday, August 25, 2005 7:15 PM
> 
> At 12:55 PM 2005-08-25, you wrote:
> >If on your page, your container is stretching to be as big 
> as your image,
> >then wont {container.offsetHeight} always be equal to 
> {image.height} (less
> >any padding)?
> 
> No, because the image is floated right. The behaviour of 
> float usually 
> seems to make it so that float acts as if it's not part of 
> the div. I've 
> never really "gotten" it, but that's how it seems to be.

There is a quirk with floated elements, in some browsers they do not
influence the height of their parent unless a subsequent element in the same
container clears it (style="clear:right").

Do you have an example to demonstrate this?

In response to other observations on resampling, it depends on users'
hardware, operating system and browser.  I've not experienced poor quality
client-side resizing in ages, but I'm using a decent machine.  Server-side
resizing will definitely produce consistent results, and will perform well
if you only have a few discreet sizes for an image (e.g. passport, postcard
& poster).  But client-side resizing would perform better if your scenario
involves a truly variable rendered size for an image a user typically sees
more than once on a page or during their visit.

- LK


===========================================================
Our e-mail domain has now changed from iraspire.com to hmrcaspire.com. Please update your address books.
===========================================================



More information about the thelist mailing list