My brother approached me with a web design problem this morning that I’m proud to say I was able to solve with a little javascript/css hackery.
Say you have a site where people can upload images. You want to display thumbnails of these images in an area of fixed dimensions, say 100 X 100 pixels. You don’t want to distort the image, and you want to maximize the image size. So you want to scale the image according to its orientation.
I coded up a solution here. View the source to see what’s going on here.
Side effects like headaches and diarrhea can be cheap no prescription viagra observed. Gullible men are often duped by these online pharmacies by supplying broken pills or cheapest viagra counterfeit pills or sometimes medicines which have provided a great relief to the people. Os it has nothing to with the diseases that occur due to tadalafil from cipla sex or intercourse. But these may be time consuming and complex, thus to help you have healthier erections easily, we bring forth realistic tips that not just assure but will definitely maximize your erections on all fronts. viagra pills wholesale
This technique is probably old hat to web designers, but it was a bit new to me. Works a lot better in Firefox and Safari than in IE, but it’s probably good enough to satisfy most Windows users. 😉
That hat it so old… 🙂
I think you can get away without the second line with the Math.round() stuff, which is just extra calculation. The browser should automatically resize and keep the original ratio when only one dimension (height or width) is present.
You *can* get away with the extra calculation on Firefox and Safari, but not with IE.