spacer

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

home / experts / dhtml / column19

Logo

Cross-Browser Visibility Transitions
transitions 4-7: wipes

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


Element
Visibility
Transitions
 hidden-to-visible
IE4 behavior:
  as described
NS4 behavior:
Boldsame as IE4
BItalicsimilar to IE4
Italicother trans substituted
Box in 0
Box out 1
Circle in 2
Circle out 3
Wipe up 4
Wipe down 5
Wipe right 6
Wipe left 7
Vertical blinds 8
Horizontal blinds 9
Checkerboard across10
Checkerboard down11
Random dissolve12
Split vertical in13
Split vertical out14
Split horizontal in15
Split horizontal out16
Strips left down17
Strips left up18
Strips right down19
Strips right up20
Random bars horizontal21
Random bars vertical22
Random23

The simplest of all our transitions are the four "wipe" transitions. They involve the clipping of one side only for a visible-to-hidden effect.

For vertical wipes (transitions 4 and 5) we determine the clip increment by simply dividing the complete original height (fullH) by the number of function visits (visits):

case 4:
    increment = fullH/visits;
    whichEl.transFunct = four;
    break;

case 5:
    increment = fullH/visits;
    whichEl.transFunct = five;
    break;

For horizontal wipes we divide the full width by visits:

case 6:
    increment = fullW/visits;
    whichEl.transFunct = six;
    break;

case 7:
    increment = fullW/visits;
    whichEl.transFunct = seven;
    break;

four()

For the wipe-up transition, we clip the bottom side of the element by the increment on every function visit. When the height has been completely clipped away, the function calls are cancelled and hideIt() is called to hide the element and restore it to its original size.

function four(){
    this.clip.bottom -= increment;
    if (this.clip.height <= 0) {
        clearInterval(transTimer);
        this.hideIt();
    }
}

five()

The wipe-down transition is identical to wipe-up, only we clip the top side:

function five(){
    this.clip.top += increment;
    if (this.clip.height <= 0) {
        clearInterval(transTimer);
        this.hideIt();
    }
}

six()

To perform a wipe-right, we clip the left side of the element:

function six(){
    this.clip.left += increment;
    if (this.clip.width <= 0) {
        clearInterval(transTimer);
        this.hideIt();
    }
}

seven()

Finally, the wipe-left transition involves clipping the right side.

function seven(){
    this.clip.right -= increment;
    if (this.clip.width <= 0) {
        clearInterval(transTimer);
        this.hideIt();
    }
}

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

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