File: /home/eris.org.uk/public_html/javascript/expand.js
/* ---------------------------------------------
expandAll v.1.3.7
http://www.adipalaz.com/experiments/jquery/expand.html
Requires: jQuery v1.3+
Copyright (c) 2009 Adriana Palazova
Dual licensed under the MIT (http://www.adipalaz.com/docs/mit-license.txt) and GPL (http://www.adipalaz.com/docs/gpl-license.txt) licenses
------------------------------------------------ */
(function($) {
/* ---------------------------------------------
Toggler - http://www.adipalaz.com/experiments/jquery/expand.html
When using this script, please keep the above url intact.
*** Feel free to remove the Toggler script if you need only the plugin expandAll().
------------------------------------------------ */
$.fn.toggler = function(options) {
var defaults = {
cllpsEl : 'div.collapse',
method : 'slideToggle',
speed : 'slow',
container : '', //http://the/ common container of all groups with collapsible content (optional)
initShow : '.shown' //http://the/ initially expanded sections (optional)
};
var o = $.extend({}, defaults, options);
var $this = $(this);
$this.wrapInner('<a style="display:block" href="#" title="Expand/Collapse" />');
if (o.initShow) {$(o.initShow).addClass('shown');}
$this.next(o.cllpsEl + ':not(.shown)').hide();
return this.each(function() {
var container;
(o.container) ? container = o.container : container = 'html';
if ($this.next('div.shown').length) { $this.closest(container).find('.shown').show().prev().find('a').addClass('open'); }
$(this).click(function() {
$(this).find('a').toggleClass('open').end().next(o.cllpsEl)[o.method](o.speed);
return false;
});
});};
})(jQuery);