Difference between revisions of "MediaWiki:Common.js"

From RimWorld Wiki
Jump to navigation Jump to search
m
m (Undo revision 18027 by AcDie (talk))
Line 12: Line 12:
 
     });
 
     });
 
     $('#mtoogle').toggle(function () {
 
     $('#mtoogle').toggle(function () {
         document.getElementById('playTune').play(), $('#mtoogle').addClass('play');
+
         $('#playTune')[0].play(), $('#mtoogle').addClass('play');
 
     }, function () {
 
     }, function () {
         document.getElementById('playTune').pause(), $('#mtoogle').removeClass('play');
+
         $('#playTune')[0].pause(), $('#mtoogle').removeClass('play');
 
     });
 
     });
 
});
 
});

Revision as of 13:38, 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');
    });
});