Różnica pomiędzy stronami "Strona główna" i "MediaWiki:Common.js"
(Różnica między stronami)
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…") |
|||
Linia 1: | Linia 1: | ||
− | + | $('.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(); |
Aktualna wersja na dzień 21: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();