Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2007
    Thanked 0 Times in 0 Posts

    Question Image width="auto" not working in IE

    I am applying width auto to the images which is not working in IE9.

    How can i get the width and height of the image on load so that i can apply width and height to the images dynamically.

  2. #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 932 Times in 919 Posts
    You shouldn't be trying to size images dynamically - they already have a width and height intrinsic to the image and if you want to resize them from that you should use a graphics program to do so. Browsers are not designed to resize images and will make a mess of the image if you try to display it at anything other than its actual size.

    So if you want to automatically resize images then use server side processing that calls a proper graphics routine to do it.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts