Frank Ralf (talk | contribs) |
Frank Ralf (talk | contribs) |
||
Line 3: | Line 3: | ||
== Collapsible course list == | == Collapsible course list == | ||
< | <code javascript> | ||
jQuery('.section h3').wrapInner('<a href="#" />') | jQuery('.section h3').wrapInner('<a href="#" />') | ||
.click( function(event) { | .click( function(event) { | ||
Line 10: | Line 10: | ||
}) | }) | ||
jQuery('ul.section').hide(); | jQuery('ul.section').hide(); | ||
</ | </code> |
Revision as of 16:00, 6 November 2011
Some examples and proof of concept for using jQuery for enhancing Moodle usability.
Collapsible course list
jQuery('.section h3').wrapInner('<a href="#" />')
.click( function(event) {
event.preventDefault();
jQuery(this).parent().find('ul.section').toggle();
})
jQuery('ul.section').hide();