Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
(Spoiler test) |
m (Spoiler test) |
||
Line 5: | Line 5: | ||
$(this).toggleClass('opened').toggleClass('closed').next().slideToggle(); | $(this).toggleClass('opened').toggleClass('closed').next().slideToggle(); | ||
if($(this).hasClass('opened')) { | if($(this).hasClass('opened')) { | ||
− | $(this).html(' | + | $(this).html(' [hide] '); |
} | } | ||
else { | else { | ||
− | $(this).html(' | + | $(this).html(' [show] '); |
} | } | ||
}); | }); | ||
}); | }); |
Revision as of 04:13, 25 October 2013
/* Any JavaScript here will be loaded for all users on every page load. */ jQuery(document).ready(function($) { $('.spoiler-body').hide(); $('.spoiler-title').click(function(){ $(this).toggleClass('opened').toggleClass('closed').next().slideToggle(); if($(this).hasClass('opened')) { $(this).html(' [hide] '); } else { $(this).html(' [show] '); } }); });