MediaWiki:Common.js: Różnice pomiędzy wersjami

Z Henryk Dąbrowski
Przejdź do nawigacji Przejdź do wyszukiwania
(Utworzono nową stronę "$('.spoiler').click( function(e) { var $this, $next, hidden; $this = $(this); $next = $this.next(); hidden = ($next.css('display') === 'none'); $ne…")
 
(Brak różnic)

Aktualna wersja na dzień 22:33, 18 wrz 2022

$('.spoiler').click(
  function(e) {
    var $this, $next, hidden;
    $this = $(this);
    $next = $this.next();
    hidden = ($next.css('display') === 'none');
    $next.css('display', hidden ? 'inline-block' : 'none');
    $this.text(
        hidden ?
            $this.data('hide') || 'Hide' :
            $this.data('show') || 'Show'
    );
  }
);
$('.spoilerText').hide();