Différences entre les versions de « MediaWiki:Common.js »
Aller à la navigation
Aller à la recherche
Ligne 10 : | Ligne 10 : | ||
$tabs.each(function() { | $tabs.each(function() { | ||
var $this = $(this); | var $this = $(this); | ||
var active = $this. | var active = $this.attr('aria-controls') === target; | ||
$this | $this |
Version actuelle datée du 23 novembre 2023 à 21:22
$(function() { $('.mw-information-box .mw-gallery').each(function() { var $gallery = $(this); var $tabs = $gallery.find('.mw-gallery-tabs button'); var $panes = $gallery.find('.mw-gallery-panes .mw-gallery-pane'); $gallery.on('click', 'button[data-target]', function() { var target = $(this).attr('aria-controls'); $tabs.each(function() { var $this = $(this); var active = $this.attr('aria-controls') === target; $this .toggleClass('active', active) .attr('aria-selected', active ? 'true' : 'false') ; }); $panes.each(function() { var $this = $(this); var active = $this.attr('id') === target; $this.toggleClass('active', active); }); }); }); });