SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Resource

IMG Tag Wizard

Categories...
Client User Group
HTML, CSS and XML, Site Design
Language
JavaScript
Product
IE4, IE5, NS3, NS4
Task
HTML Enhancement, Image Manipulation, Utilities
Technology
ECMA-262, HTML

Sponsored Links
Developer's Paradise : Inside Technique :
IMG Tag Wizard
Submission by SiteExperts Staff

Go to the resource:
IMG Tag Wizard

Add to Assistant

Short Description
A simple wizard that determines the size of an image and creates the appropriate HTML.

Long Description
We often find ourselves using a graphics package or a simple HTML script to determine the size of an image. This wizard is an efficient way to determine the size of any image and generate the appropriate HTML.

Author
Scott Isaacs
Date/ Version
2/15/1999
Submission URL
http://www.SiteExperts.com/tips/html/ts11/page1.asp
Submission Date
Feb 15,1999
Last Update
Feb 15,1999
 

Discussion and Rate this Resource
Overall Rating: 3.7

Silent E on Oct 25, 2000 at 5:03:32 PMNo Rating

I experienced the 0 height and 0 width problem myself.  I did get it to work.  Here's how.  BTW - I'm in IE 5.01

  1. View-source and go to the bottom of the source listing
  2. There are three files you need to grab from the source:
    • doLoad()
    • doError()
    • LoadImage()
  3. Call LoadImage() from your eventhandler of choice in the <input> tag
  4. In doLoad(), perform whatever actions you need to do with the image information.
  5. doError() will fire if the object loaded isn't an image.

I figure the problem everyone was encountering was fixed by line 1 of the LoadImage function.  The "new Image" call actually creates the object reference for IE to properly evaluate the height and width of the image.  Not sure what it was referencing when the values weren't correct.  I would guess that because it's just text in an <input> tag, it's not an inline object that has reference to the height and width values.

However, I've been know to be wrong.  Every once-in-a-while.  <grin />

dragos on Sep 18, 2000 at 10:28:59 AMRating: 3
It's nice! Too bad it works only on IE4!
Runrig on Sep 14, 1999 at 4:23:03 AMRating: 4

Seems like a great idea to save time.  Does anyone know of a program that automatically reduces the size of jpeg or gif pictures to allow faster loading of pages.

Thanks

Runrig

dmdorey on Sep 6, 1999 at 7:17:55 PMRating: 4
I only wish that all the tag attributes had quotes.
dmdorey on Mar 20, 1999 at 5:39:43 AMRating: 4
As a student at ZDU currently studying
Html4 part 3 I found your coding very
helpful and one I will continue to use in the future. It so impressed me that I reproduced it (with proper credits and a link to the original article)so that other students could see it. You can check it by going to
http://www.niagara.com/dmdorey/
java1.html
If you so request I will remove the page post haste.TIA

More Ratings/ Comments


To rate and comment on a resource, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password

Copyright © 1997-2008 InsideDHTML.com, LLC. All rights reserved.