spacer

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

home / experts / dhtml / column19

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

Logo

  Cross-Browser Visibility Transitions
  SPECIAL EDITION; the director's cut 1/2

The HTML Page

Any page that uses the library should have browser-detection, a dummy doTrans() function for non-DHTML browsers and the insertion of the external script:

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!--

    NS4 = (document.layers) ? 1 : 0;
    IE4 = (document.all) ? 1 : 0;
   ver4 = (NS4 || IE4) ? 1 : 0;   
  isMac = (navigator.appVersion.indexOf("Mac") != -1) ? 1 : 0;
isTrans = (NS4 || (IE4 && !isMac)) ? 1 : 0;

function doTrans() {return};

//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript1.2">
<!--
if (isTrans) {
    document.write("<SCRIPT [keep with next line]
   LANGUAGE='JavaScript1.2' SRC='trans.js'><\/SCRIPT>");
}
//-->
</SCRIPT>

</HEAD>

Using the Transitions

To use a transition, issue the following statement in a script or event handler:

doTrans(elementIDstring,transitionNumber,transitionDuration(secs))

For example, to hide an element called elTrial, using a wipe left transition that lasts four and a half seconds, use this statement:

doTrans("elTrial",7,4.5)

Four of the transitions: 1, 3, 14 and 16 show the element. The remainder hide the element. Therefore, in these four cases, the original state of the element should be hidden. Otherwise, the original state should be visible.

The next page lists the external script.


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: Apr. 28, 1998
Revised: Apr. 28, 1998

URL: http://www.webreference.com/dhtml/column19/allCode1.html