User:Frank Ralf/jQuery

< User:Frank Ralf
Revision as of 16:04, 6 November 2011 by Frank Ralf (talk | contribs) (Collapsible course list)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Frank Ralf/jQuery.

Some examples and proof of concept for using jQuery for enhancing Moodle usability.

You can try those code snippets without changing your Moodle installation by using the Firebug extension FireQuery.

Collapsible course list

jQuery('.section h3').wrapInner('<a href="#" />')  // make the heading clickable
  .click( function(event) {
    jQuery(this).parent().find('ul.section').toggle();  // toggle the content of the section
jQuery('ul.section').hide();   // hide by default