Difference between revisions of "MediaWiki:Common.js"

From RimWorld Wiki
Jump to navigation Jump to search
m
m
Line 11: Line 11:
 
         }
 
         }
 
     });
 
     });
 +
    $('#element').tooltip('toggle');
 
});
 
});

Revision as of 13:58, 12 January 2014

/* 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] ');
        }
    });
    $('#element').tooltip('toggle');
});