Template:Spoiler/spoiler.js

From Witscopedia
Revision as of 03:14, 3 November 2025 by Staz (talk | contribs) (Created page with "→‎Template:Spoiler on dev.miraheze.org: $(function(){ //spoiler block behavior $('.spoiler').click(function(){ $(this).toggleClass('off'); }); // spoiler button behavior $('#spoilerbtn').text('Show all spoilers'); $('#spoilerbtn').click(function(){ $(this).toggleClass('hide'); $('.spoiler').toggleClass('showall'); if ($(this).is('.hide')){ $(this).text('Hide all spoilers'); } else { $(this).text('Show all spoilers'); } }); });")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

/*

   Template:Spoiler on dev.miraheze.org
  • /

$(function(){

   //spoiler block behavior

$('.spoiler').click(function(){ $(this).toggleClass('off'); }); // spoiler button behavior

   $('#spoilerbtn').text('Show all spoilers');

$('#spoilerbtn').click(function(){ $(this).toggleClass('hide'); $('.spoiler').toggleClass('showall');

if ($(this).is('.hide')){ $(this).text('Hide all spoilers'); }

       else { $(this).text('Show all spoilers'); }

}); });