spacer

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

home / experts / dhtml / column19

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source
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.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Working with the DOM Stylesheets Collection · Administering RBAC in PHP 5 CMS Framework · xref: Automatic Cross Referencing Script
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Combine BottomCount() with Other MDX Functions to Add Sophistication · Creating a Daemon with Python · The Coming Voice-over-WiMAX Revolution

All Rights Reserved. Legal Notices.
Created: Apr. 28, 1998
Revised: Apr. 28, 1998

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