![]() |
Resizing only large images, not small ones.
I have an html question about resizing an image. How do you resize an image only if it's too big.
For instance if I have an image that is 500px wide and I want to down size it to 450px wide I can write something like this: Code:
<embed src="$filename" How would I write it so that only images over 450px would get resized but images under 450px would stay the same. Thanks in advanced! |
<img src="blah" onload="if(this.width > 450) {this.width=450;}" />
|
This works alot better, Thanks! Is there a way to write it so that I do not see the image resize when the page loads? The embed tag I used did not do that, but the image one I use does.
Code:
<div align="center"> |
Try this:
<img src="$filename" onload="if(this.width > 450) {this.width=450;} this.style='';" style="display:none;" /> |
The image doesn't load at all with that code.
|
Maybe try to put it in div with size 1x1 and overflow:hidden and when image loads resize that div to image size?
|
I'm sorry, my coding skills aren't that good. I'm not really sure what you are describing.
|
All times are GMT. The time now is 07:30 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|