MediaWiki:FandomMobile.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
See http://www.zeldawiki.org/MediaWiki_talk:Tabs.js for examples and documentation | See http://www.zeldawiki.org/MediaWiki_talk:Tabs.js for examples and documentation | ||
*/ | */ | ||
console.log('cachebreak'); | |||
$(function(){ | $(function(){ |
Latest revision as of 21:44, 6 December 2021
/*
Simple but flexible javascript tabs
v0.3
Author: Abdullah A. Abduldayem
Contact: http://www.zeldawiki.org/User:Abdullah
See http://www.zeldawiki.org/MediaWiki_talk:Tabs.js for examples and documentation
*/
console.log('cachebreak');
$(function(){
// When a tab is clicked
$(".tab").click(function () {
var $siblings= $(this).parent().children();
var $alltabs = $(this).closest(".tabcontainer");
var $content = $alltabs.parent().children(".tabcontents");
// switch all tabs off
$siblings.removeClass("active");
$content.children().removeClass("content--active");
// switch this tab on
$(this).addClass("active");
var index = $siblings.index(this);
$content.children().eq(index).addClass("content--active");
});
});