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 image enlargement with Lightbox 2

Lightbox 2 is a very popular script based on script.aculo.us (and in turn, based on Prototype) which provides a slick way to open links to high-resolution versions of thumbnail images in a modal window.

In this recipe, we will integrate Lightbox 2 into our page, and add an image thumbnail to which we will apply the Lightbox 2 functionality.

Getting ready

First, we need to obtain a copy of Lightbox 2, by visiting http://www.huddletogether.com/projects/lightbox2/, and navigating to the download section. Download the ZIP file of the latest version, and unpack it to the cook subdirectory of the Moodle installation used in this example, that is, /path/to/moodle/cook/lightbox2.

Tip

Lightbox 2 contains links to ...

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