spacer

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

home / experts / dhtml / column12
Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Logo

Expandable Outlines
Explorer 4: using toggled images


Click the triangles to expand the headings: (IE4 only)

Expand/Collapse Item World Wide Web Consortium (W3C)

Expand/Collapse Item Netscape

In the first example, above, the image is contained in a link, as our first example on the previous page:

The expandIt() function is modified to swap images, to reflect the expanded/collapsed state of the element:

Notice that the image to be swapped is identified as event.srcElement. That is, the element that received the event (click). Although the click was meant for the link (A) element, Explorer's bottom-up approach to event handling identifies the IMG as the event source element, and since this element does not define an action for the event, it is passed up to the A.

Explorer event handling is discussed in Dynamic Images, in the context of the column examples, and generally, in Doc JavaScript's The Internet Explorer Event Model.

The second example avoids the link, and uses onClick as an event handler of IMG.

Notes: The ALT attribute is displayed by both DHTML browsers when the mouse is over the image. This new behaviour makes ALT a "hint" or "extra info" attribute as well as a label for non-graphical or images-off browsers. Use it to provide information on links or click actions.
When Navigator 4 parses the STYLE attribute in the IMG tag, it renders the IMG and possibly succeding elements incorrectly. Although cursor:hand is a helpful property here, it should be used only in Explorer-specific applications.

The complete Explorer code is repeated in our first code page.

I know, it's not challenging. The same, however, cannot be said for the Navigator version!


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 >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger

All Rights Reserved. Legal Notices.
Created: Jan. 14, 1998
Revised: Jan. 18, 1998

URL: http://www.webreference.com/dhtml/column12/outIEtwo.html