O'Reilly logo

Moodle JavaScript Cookbook by Alastair Hole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding the script.aculo.us add-on to Prototype

The script.aculo.us library is an add-on for Prototype that contains several user interface enhancements such as animation, drag-and-drop and AJAX controls. In this recipe, we will set up script.aculo.us and add a shake animation effect to verify it has loaded correctly.

Getting ready

First, we need to obtain a copy of script.aculo.us by visiting http://script.aculo.us/, and navigating to the download page. Download the ZIP archive of the current version, and unzip it into a folder named scriptaculous inside the cook subdirectory of the Moodle installation used in this example, that is, /path/to/moodle/cook/scriptaculous.

How to do it...

Create a PHP file, external_scriptaculous.php, with the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required