MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Considering this template for a minesweeper spoiler solution |
No edit summary |
||
| Line 1: | Line 1: | ||
/* <nowiki> */ | |||
/* [[Template:Spoiler]] */ | /* [[Template:Spoiler]] */ | ||
$(function () { | $(function () { | ||
| Line 12: | Line 12: | ||
}); | }); | ||
/* End Template:Spoiler */ | /* End Template:Spoiler */ | ||
/* </nowiki> */ | |||
Latest revision as of 21:38, 9 October 2025
/* <nowiki> */
/* [[Template:Spoiler]] */
$(function () {
$('.spoiler-content')
.off('click') // in case this code is loaded twice
.on('click', function(e){
$(this).toggleClass('show');
}).find('a').on('click', function(e){
e.stopPropagation();
});
});
/* End Template:Spoiler */
/* </nowiki> */