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

    reading the width and height of an image

    I am working on a page that will show a number of images that will be changed often. To make this easier I would like to just be able to load the file name and address into an array, and then have a script do all the work for me

    For the most part I have it working fine. But as things stand I have to also add the width and height info of the image. I need to do this so that if an image is to big for the page the script can resize it to fit with out changing it's shape. What i would like to do is have the script check the file for this info.

    is the a script the returns the width and hight of an image ???

    thanks for taking the time to read this
    Last edited by benlyboy; 09-25-2003 at 03:46 PM.

  • #2
    Regular Coder Vincent Puglia's Avatar
    Join Date
    Jul 2003
    Location
    where the World once stood
    Posts
    367
    Thanks
    0
    Thanked 13 Times in 13 Posts
    Hi,

    alert(document.images[imageName].width)
    alert(document.images[0].width)
    alert(document.images[imageName].height)
    alert(document.images[0].height)

    Vinny
    Where the world once stood
    the blades of grass
    cut me still

  • #3
    New Coder
    Join Date
    May 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Vinny just what i was looking for...


  •  

    Posting Permissions

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