Tutorials Point

  Learn script.aculo.us
  script.aculo.us Resources
  Selected Reading

Copyright © 2014 by tutorialspoint

  Home     References     Discussion Forums     About TP  

script.aculo.us Effects

previous next AddThis Social Bookmark Button


The script.aculo.us effects are divided into two groups:

Library files required for Effects:

To use the effects capabilities of script.aculo.us, you will need to load the effects module. So, your minimum loading for script.aculo.us will look like this:

<title>script.aculo.us effects</title>

<script type="text/javascript"  src="/javascript/prototype.js">
<script type="text/javascript"  src="/javascript/"effects.j">


Syntax to call Effect Functions :

The proper way to start a core effect is usually with the new operator. Depending on your preferences, you can use one of two syntaxes:

new Effect.EffectName(element [, requiredArgs ] [ , options ] )


element.visualEffect('EffectName' [, requiredArgs ] [,options])

These two syntaxes are technically equivalent. Choosing between the two is mostly about your personal sense of code aesthetics.

Simple Example:

Here are two equivalent calls, so you can see how the syntaxes are related, which are very much interchangeable:

new Effect.Scale('title',
                  { scaleY: false, scaleContent: false });


$('title' ).visualEffect('Scale', 
		 { scaleY:false, scaleContent:false });

previous next Printer Friendly