Core fx
The content of this chapter up to this point has concentrated
entirely on the animation facilities that are provided by Base. The
existing functionality in Base consisting of fadeIn, fadeOut, and animateProperty covers a tremendous amount
of use cases; however, there are a few additional functions provided
in Core's fx module that you can
get for the cost of one additional dojo.require statement. These facilities for
effects include functions for sliding nodes and wiping nodes in and
out, as well as chaining, combining, and toggling
animations.
Sliding
Sliding nodes is just as easy as fading them. You pass a hash
containing configuration parameters to the dojo.fx.slideTo function just like you
would with animateProperty. Table 8-5
summarizes.
Table 8-5. Parameters for Core's slide functions
Parameter | Type | Comment |
|---|---|---|
| DOM Node | The node that will be sliding. |
| Integer | How many milliseconds the fade should last. Default value is 350. |
| Function | A function that
adjusts the acceleration and/or deceleration of the progress
across a curve. Default value is Note that the easing
function is only defined from a domain of 0 to 1 for the
|
| Integer | Where the node's left corner should be at the end of the slide. |
| Integer | Where the node's top corner should be at the end of the slide. |
Example 8-3 illustrates the sliding functions. The only portions of the page that are any different from the previous fade examples are emphasized. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access