...Thanks. I guess I didn't myself clear -- this isn't all of the code. This script is part of another huge script that works fine, that's why
A few things to note:
I’m trying to write a resizing script. I actually wrote one that worked fine in Safari and Firefox, but IE8 failed to make it work so I had to rewrite it.
The goal of this script is to be able to resize any image ratio (no matter how crazy) to fit into a 720 by 480 container. The whole image has to show aswell.
Right now, the code works for everything except images that are over 480px tall and ridiculously wide.
Help would be pretty freakin’ sweet.
Try debugging your JS using firebug. You will find that on line 11 you have an error with
image, which is undefined. The alert command is never run at this point.
Like I said, try debugging your JS with firebug, I think it will help you out here
image isn't defined. It's defined earlier, which is irrelevant to _this_ script.
Anyway, I’ll just figure it out myself. Doesn’t seem like anyone here has seen an image resizing script in their lives…
Thanks for everyone’s help, I appreciate it!
That last line is a little insulting, I have built an entire image gallery manager and resizer, so I do know all about image resizing, and it really should be done on the server side anyway if you are going to be scaling a bunch of images.
Also, how are we supposed to know that is not all the code if you didn’t give it?
No matter what I still suggest you start following best coding practices and ending your line statements with ‘;’
Best of luck with your script