December 23, 200817 yr I'm getting images from my database and displaying them on a page, but sometimes the images are too big and they push the page structure out. I could set it to hide on overflow, but that's ugly. What i want to do is resize the image if the dimensions of it are more than 'x'. I've been looking for a javascript to do this but haven't been successful. Has anyone used anything similar? Thanks
December 23, 200817 yr Author I just remember CSS's max-width (doh). Here's what i found worked if anyone wants to know: .img { width: expression(document.body.clientWidth > 100? "100px" : "auto"); /* IE hack */ max-width:100px } <img src="lol.jpg" class="img" />
Create an account or sign in to comment