Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image resizing 1

Status
Not open for further replies.

webmigit

Programmer
Aug 3, 2001
2,027
US
I have a server side scripting generated catalog and I need to do a little image manipulation..

I know that cold fusion has third party tags available but I'd like for the server not to do the work, what I'm wondering is...

Is there a way I can say like...

<img src=&quot;image.gif&quot; onLoad=&quot;checksz(some_sort_of_identifer);&quot;>

and function checksz would be like..

function checksz(imj) {
if image.width greater than 75 {
image.width = 75
}
}

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
<img src=&quot;image.gif&quot; onLoad=&quot;checksz('myImg');&quot; id=&quot;myImg&quot;>

function checksz(imj) {
theImg = document.getElementById(imj)
if (theImg.width > 75) {
theImg.width = 75
}
}

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Great, that works great..

But I ran into a problem, if you back into the page you get big images, because.. the images aren't 'loading'... Anyway around this? When you back into the page, it still resizes?

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Unfortunately, when users use the &quot;back&quot; button, no javascript events occur on the reloaded page, which will make that difficult...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
What about adding a 'no-cache' statement to your meta tags at the top of the page?

I forget the exact context of its usage, but I'd think that would cause your pages to always auto-reload.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top