MediaWiki:Common.js: Difference between revisions
From Rebellious Projects Wiki
Created page with "→Any JavaScript here will be loaded for all users on every page load.: $('.pi-image-collection').each(function() { var $tabs = $(this).find('.pi-image-collection-tab'); var $images = $(this).find('.pi-image-collection-image'); $tabs.on('click', function() { var index = $(this).index(); $tabs.removeClass('active'); $images.removeClass('active'); $(this).addClass('active'); $images.eq(index).addClass('active');..." |
No edit summary |
||
| Line 1: | Line 1: | ||
$(document).ready(function() { | |||
$('.pi- | $(document).on('click', '.pi-tab-link', function() { | ||
var $collection = $(this).closest('.pi-media-collection'); | |||
var tabId = $(this).data('pi-tab'); | |||
$collection.find('.pi-tab-link').removeClass('current'); | |||
$collection.find('.pi-media-collection-tab-content').removeClass('current'); | |||
$ | |||
$(this).addClass('current'); | |||
$(this).addClass(' | $collection.find('#' + tabId).addClass('current'); | ||
$ | |||
}); | }); | ||
}); | }); | ||
Revision as of 07:28, 15 March 2026
$(document).ready(function() {
$(document).on('click', '.pi-tab-link', function() {
var $collection = $(this).closest('.pi-media-collection');
var tabId = $(this).data('pi-tab');
$collection.find('.pi-tab-link').removeClass('current');
$collection.find('.pi-media-collection-tab-content').removeClass('current');
$(this).addClass('current');
$collection.find('#' + tabId).addClass('current');
});
});
No categories

