Chapter 11. script.aculo.us Reference
The script.aculo.us library by Thomas Fuchs (with numerous contributions from the community) is distributed in six files: scriptaculous.js, builder.js, effects.js, dragdrop.js, controls.js, and slider.js.[1] Including scriptaculous.js will automatically include the other five files, if they are in the same directory. Prototype (which script.aculo.us depends on) must be included separately.
<script src="/js/prototype.js" type="text/javascript"></script> <script src="/js/scriptaculous.js" type="text/javascript"></script>
The standard Rails skeleton (as generated by rails
myapp
) includes effects.js, dragdrop.js, and controls.js in the public/javascripts directory.
From within a Rails view or layout file, the javascript_include_tag
helper can be used to include external JavaScript files. By passing it :defaults
, it will include Prototype, the Rails-standard script.aculo.us files, and application.js, if present:
<%= javascript_include_tag :defaults %>
Demos, downloads, and announcements are available from the official web site (http://script.aculo.us). Documentation and example code are available from the official wiki (http://wiki.script.aculo.us).
The script.aculo.us library (and this chapter) has seven major parts: visual effects, drag and drop, controls, element extensions, DOM builder, JavaScript unit testing, and miscellaneous utility methods.
Visual Effects
The Effect
object encapsulates script.aculo.us’ animation effects. It defines five core effects, ...
Get Ajax on Rails now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.