spacer

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

home / experts / dhtml / column3
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

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

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