O'Reilly logo

Elgg 1.8 Social Networking by Cash Costello

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

Lesson 7: Adding JavaScript

This lesson demonstrates using a jQuery plugin with Elgg.

Problem

You have been looking at pages that use really slick jQuery plugins. (Do a search on "top jquery plugins" if you are not familiar with all the possibilities offered by jQuery plugins.) Lightboxes, tool tips, charts, animations, fancy forms – the list goes on and on. You want to add a few of these jQuery plugins to your Elgg site, but you are not sure how to accomplish this.

Solution

Many jQuery plugins only require inclusion of a JavaScript file, often a CSS file, and then a little bit of JavaScript to initialize the plugin. Elgg has functions for including external JavaScript and CSS files that make this easy.

Example

In this example, we are adding a fancy ...

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