MediaWiki:Gadget-toggles.js

$(function {	// implements freeform toggle akin to Dynamic Tabs - only one section can be shown at a time	// assign class "toggle-list-item" to each toggler to make them recognized at all	// assign attr "data-toggle-section" & this value as a class to each toggler	// to make them behave together (to support multiple unrelated sections per page)	// to start something hidden, add class toggle-list-hidden	// assign attrs data-toggler-show and data-toggler-hide to each	// assign classes of the values of the attr of show/hide to the content that you want it to control	$('.toggle-list-item').each(function { $(this).click(function {			$this = $(this);			if($this.hasClass('active')) {				return;			}			var thisSection = $this.attr('data-toggle-section');			$('.' + thisSection).removeClass('active');			$this.addClass('active');			var toHide = $this.attr('data-toggler-hide');			var toShow = $this.attr('data-toggler-show');			$('.' + toHide).addClass('toggle-list-hidden');			$('.' + toShow).removeClass('toggle-list-hidden');		}); }); });