Add new transitions to Scriptaculous

Tuesday, April 1st, 2008

Not everyone knows, perhaps, but you can overwrite or add transitions effects of scriptaculous.js very easily and quickly. Scriptaculous transitions, used in effect to determine the type of animation, as those are not implemented in Flash (I recommend taking a look at this PDF of the great Robert Penner), but the final effect is - actually - the same . Moreover, the package Scriptaculous, some transitions are not present under these invence in Actionscript. If we wanted to add a new transition to Scriptaculous just add this code before you use any effect:

JavaScript:
  1. = function ( pos ) { Effect. Transitions. Exponential = function (pos) (
  2. Math. pow ( 1 - pos , 2 ) ; return 1 - Math. pow (1 - pos, 2);
  3. )

From now on we can use the new transition exponential in all the effects of Scriptaculous. For a number of transitions profits - almost ported from Scriptaculous to Actionscript - see Add some spice to Scriptaculous.

Related Post

Was this article helpful?: Per nientePocoAbbastanzaMoltoMoltissimo
Loading ... Loading ...

There are no comments for this post

Leave a comment

TAG XHTML PERMISSIONS: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre>         // blocco generico [code][/code]       // blocco generico [as][/as]           // Actionscript [css][/css]         // CSS Style Sheet [html][/html]       // HTML [js][/js]           // Javascript [objc][/objc]       // Objective-C [php][/php]         // PHP [sql][/sql]         // SQL