spacer

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

home / experts / dhtml / column19

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

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

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