Difference between revisions of "MediaWiki:Common.js"

From RimWorld Wiki
Jump to navigation Jump to search
(Spoiler test)
 
m
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
jQuery(document).ready(function($) {
+
 
$('.spoiler-body').hide();
+
jQuery(document).ready(function ($) {
$('.spoiler-title').click(function(){
+
    $('.spoiler-body').hide();
    $(this).toggleClass('opened').toggleClass('closed').next().slideToggle();
+
    $('.spoiler-title').click(function () {
    if($(this).hasClass('opened')) {
+
        $(this).toggleClass('opened').toggleClass('closed').next().slideToggle();
         $(this).html('Hide');
+
        if ($(this).hasClass('opened')) {
     }
+
            $(this).html('  ');
     else {
+
         } else {
         $(this).html('Show');
+
            $(this).html('  ');
     }
+
        }
});
+
     });
 +
     /*
 +
    $('#mtoogle').toggle(function () {
 +
         $('#playTune')[0].play(), $('#mtoogle').addClass('play');
 +
     }, function () {
 +
        $('#playTune')[0].pause(), $('#mtoogle').removeClass('play');
 +
    });
 +
    */
 
});
 
});

Latest revision as of 15:18, 11 March 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('  ');
        } else {
            $(this).html('  ');
        }
    });
    /*
    $('#mtoogle').toggle(function () {
        $('#playTune')[0].play(), $('#mtoogle').addClass('play');
    }, function () {
        $('#playTune')[0].pause(), $('#mtoogle').removeClass('play');
    });
    */
});