Skip to Content | Skip to Navigation


dojox.widget.rotator.Fade

Authors:Chris Barber
Project owner:Chris Barber
Available:since V1.4

A fade and cross-fade transition for a dojox.widget.Rotator or dojox.widget.AutoRotator.

Usage

The fade rotator transition is not an instantiated object, but rather a series of functions which consist of:

  • fade() - Returns a dojo.Animation that fades out the current pane, then fades in the next pane.
  • crossFade() - Returns a dojo.Animation that cross-fades two rotator panes.

These functions are invoked by the rotator and may be different per pane.

Each function is passed an object containing the “transitionParams” along with the rotator’s current and next pane which are to be panned, then returns a dojo.Animation object describing the animated sequence.

Examples

Programmatic example

Example using the fade transition.

Declarative example

Example using cross-fade transition.

See also



  • Demo
  • Copy&Paste
  • HTML
  • CSS
 
Copy to clipboard

To run the demo in your own environment, copy and paste the full source into an editor and open it in a browser.

Copy to clipboard
<div id="myAutoRotator1" class="rotator">
</div>
<button onclick="dojo.publish('myAutoRotator1/rotator/control', ['prev']);">
    Prev
</button>
<button onclick="dojo.publish('myAutoRotator1/rotator/control', ['go', 0]);">
    Go 1
</button>
<button onclick="dojo.publish('myAutoRotator1/rotator/control', ['go', 1]);">
    Go 2
</button>
<button onclick="dojo.publish('myAutoRotator1/rotator/control', ['go', 2]);">
    Go 3
</button>
<button onclick="dojo.publish('myAutoRotator1/rotator/control', ['next']);">
    Next
</button>
Copy to clipboard
version:local
<style type="text/css">
    .rotator{ background-color:#fff; border:solid 1px #e5e5e5; width:400px;
    height:180px; overflow:hidden; } .pane{ background-color:#fff; width:400px;
    height:180px; overflow:hidden; padding: 10px; } .pane0{ background-color:#fff79e;
    } .pane1{ background-color:#ffd4a0; } .pane2{ background-color:#ffa0a0;
    }
</style>
  • Demo
  • Copy&Paste
  • HTML
  • CSS
 
Copy to clipboard

To run the demo in your own environment, copy and paste the full source into an editor and open it in a browser.

Copy to clipboard
<div dojoType="dojox.widget.AutoRotator" class="rotator" id="myAutoRotator2"
jsId="myAutoRotatorInstance2" transition="dojox.widget.rotator.crossFade"
duration="2500">
    <div class="pane pane0">
        Pane 0
    </div>
    <div class="pane pane1">
        Pane 1
    </div>
    <div class="pane pane2">
        Pane 2
    </div>
</div>
<button onclick="dojo.publish('myAutoRotator2/rotator/control', ['prev']);">
    Prev
</button>
<button onclick="dojo.publish('myAutoRotator2/rotator/control', ['go', 0]);">
    Go 1
</button>
<button onclick="dojo.publish('myAutoRotator2/rotator/control', ['go', 1]);">
    Go 2
</button>
<button onclick="dojo.publish('myAutoRotator2/rotator/control', ['go', 2]);">
    Go 3
</button>
<button onclick="dojo.publish('myAutoRotator2/rotator/control', ['next']);">
    Next
</button>
Copy to clipboard
version:local
<style type="text/css">
    .rotator{ background-color:#fff; border:solid 1px #e5e5e5; width:400px;
    height:100px; overflow:hidden; } .pane{ background-color:#fff; width:400px;
    height:100px; overflow:hidden; } .pane0{ background-color:#fff79e; } .pane1{
    background-color:#ffd4a0; } .pane2{ background-color:#ffa0a0; }
</style>