www.webdeveloper.com
Results 1 to 2 of 2

Thread: Image Height and Width Help

  1. #1
    Join Date
    Jul 2003
    Posts
    6

    Image Height and Width Help

    Hi. I'm fairly new to JavaScript, so perhaps this question may seem trivial. Is there a way to get the height and width of an image using JavaScript? Do I need to worry about preloading it? What I eventually want to do is create some script to write the <IMG> tags for several pictures, complete with HEIGHT and WIDTH properties. Any help would me much appreciated!

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,119
    yes get reference to the image

    and then
    img.width or img.height
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles