spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / dhtml / column3
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Logo

Zooming Images by Name
doing the advisable

More often than not, this is the routine that will be used. However, it is also the only routine that may involve intervention into the HTML of an already existing document. If the document does not have a coherent image NAMEing scheme, we will have to go and give each of the images that we want to be zoomable in a page a unique identifier. It is advisable that all zoomable images are given a prefix, for example "imZ".

We do not have to name all our images, just the ones that will be zoomed. In our code we will check first to see if the image has a name at all.

Given what we have discussed so far, it should be elementary to produce the one line that will identify our image as zoomable.

Define a prefix

First, however, let's define a variable to hold the substring (prefix) that we will search for in the name.

if you turn this feature off, give useName a null value rather than an empty string:

Our much-maligned findIt function now reads:

<A NAME="imBigGuy">
<IMG NAME="imZJup" SRC="jupiter.jpeg" WIDTH=80 HEIGHT=60 HSPACE=20 ALIGN=LEFT></A>

<A HREF="/3d/lesson17/">
<IMG NAME="imZFruit" SRC="3d.jpg" WIDTH=80 HEIGHT=60 HSPACE=20 ALIGN=LEFT BORDER=0></A>

<A HREF="/outlook/column5/">
<IMG NAME="imRich" SRC="richWig.gif" WIDTH=80 HEIGHT=60 HSPACE=20 BORDER=0></A>

This method is the recommended method. We will cover one last feature: making sure the zoomed image stays within your display window.


Produced by Peter Belesis and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

All Rights Reserved. Legal Notices.
Created: 08/27/97
Revised: 09/28/97

URL: http://www.webreference.com/dhtml/column3/byName.html