MediaWiki:Gadget-Tabs.js

/*	Simple but flexible javascript tabs v0.2 Author: Abdullah A. Abduldayem Contact: http://www.zeldawiki.org/User:Abdullah See http://www.zeldawiki.org/MediaWiki_talk:Tabs.js for examples and documentation

$(document).ready(function{ // When a tab is clicked  $(".tab").click(function  {

var $alltabs = $(this).parent; var $content = $alltabs.parent.children(".tabcontents");

// switch all tabs off $alltabs.children.removeClass("active");

// switch this tab on   $(this).addClass("active");

// hide all content $content.children(".content").css("display","none");

// show content corresponding to the tab var index = $alltabs.children.index(this); $content.children.eq(index).css("display","block"); });	});