spacer

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

home / experts / dhtml / column3
Developer News
ActiveState Debuts Open Source Business Suite
Salesforce Offers Visual App Builder
Codesion Steps Out From CVS's Shadow

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


The Network for Technology Professionals

Search:

About Internet.com

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

webref The latest from WebReference.com Browse >
Use Web Caching to Make Your Web Site Faster · Creating an Online Shopping Cart Mechanism in PHP · Log JavaScript Errors Using an AJAX-driven Web Service
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags

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

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