Information About

Script.aculo.us




  Developer Thomas Fuchs
  Latest Release Version 170
  Latest Release Date January 19 , 2007
  Genre JavaScript Toolkit
  License MIT License
  Website scriptaculous


script.aculo.us is a JavaScript library built on the Prototype JavaScript Framework , providing dynamic visual effects and user interface elements via the Document Object Model .

It is most notably included with Ruby On Rails , but also provided separately to work with other web application Frameworks and scripting languages.

script.aculo.us was extracted by Thomas Fuchs from his work on Fluxiom , a web based Digital Asset Management tool by the design company Wollzelle .http://ajaxian.com/archives/audible-ajax-episode-12-thomas-fuchs-of-scriptaculous It was first released to the public in June 2005.


FEATURES


script.aculo.us extends the Prototype Javascript Framework by adding visual effects, user interface controls, and utilities.


Visual effects


There are five core effects script.aculo.us offers: Opacity, Scale, MoveBy, Highlight, and Parallel. Through these effects there are over 16 additional effects using combinations of the core effects out of the box. Programmers can also extend and make new effects.

Enabling an effect is a matter of assigning an element with an ID name and one line of code for the effect. Below is an example for the Effect.Fade effect applied to a DOM element with ID of 'id_of_element':

new Effect.Fade('id_of_element');

This will cause the target ID to fade in opacity and end by setting the CSS display property of none.

You can also modify various settings within the effect such as duration of the effect and range of the effect:

new Effect.Fade('id_of_element',
{ duration:2.0, from:0.0, to:0.8 });

This would fade the element, but stop when the effect is 80% complete (with an opacity of 20%).


Controls


Controls offers user interface elements including:



Builder


Builder allows the creation of DOM elements dynamically. Using the sample code below:

element = Builder.node('div',{id:'ghosttrain'},[
Builder.node('div',{className:'controls',style:'font-size:11px'},[
Builder.node('h1','Ghost Train'),
"testtext", 2, 3, 4,
Builder.node('ul',[
Builder.node('li',{className:'active', onclick:'test()'},'Record')
]),
]),
]);

Creates the following (without newlines):



Ghost Train


testtext234

  • Record






USAGE


Incorporating script.aculo.us into a website requires copying all javascript files in a folder and the following lines inserted in the head of an HTML document:




These lines must be loaded first before any javascript requesting any Prototype or script.aculo.us functions. Once loaded, these functions can be called in any valid javascript location including script tags and event handlers.


REFERENCES




RELATED LINKS



EXTERNAL LINKS