Does anyone know how to resize images proportionally using JavaScript?
I have tried to modify the DOM by adding attributes height and width on the fly, but seems did not work on IE6.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To modify an image proportionally, simply only alter one of the width/height css properties, leave the other set to auto.
This will ensure that its aspect ratio remains the same.
Bear in mind that browsers tend to suck at resizing images nicely – you’ll probably find that your resized image looks horrible.