MediaWiki:Common.js — различия между версиями

Материал из NanoWiki
Перейти к: навигация, поиск
Строка 10: Строка 10:
 
     $( this ).children( '.spoilers-hide' ).hide();
 
     $( this ).children( '.spoilers-hide' ).hide();
 
});
 
});
$( '.spoilers-button' ).click( function() {
+
$( '.spoilers-button .spoilers-show' ).click( function() {
alert('2');
+
 
 
     $( this ).parents( '.spoilers' ).find( '.spoilers-body' ).show();
 
     $( this ).parents( '.spoilers' ).find( '.spoilers-body' ).show();
 
     $( this ).children( '.spoilers-show' ).hide();
 
     $( this ).children( '.spoilers-show' ).hide();
 
     $( this ).children( '.spoilers-hide' ).show();
 
     $( this ).children( '.spoilers-hide' ).show();
 +
});
 +
$( '.spoilers-button .spoilers-hide' ).click( function() {
 +
 +
    $( this ).parents( '.spoilers' ).find( '.spoilers-body' ).hide();
 +
    $( this ).children( '.spoilers-show' ).show();
 +
    $( this ).children( '.spoilers-hide' ).hide();
 
});
 
});

Версия 12:34, 17 июня 2015

/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */
$( '.spoilers-button' ).toggle( function() {
alert('1');
    $( this ).parents( '.spoilers' ).find( '.spoilers-body' ).show();
    $( this ).children( '.spoilers-show' ).hide();
    $( this ).children( '.spoilers-hide' ).show();
}, function() {
    $( this ).parents( '.spoilers' ).find( '.spoilers-body' ).hide();
    $( this ).children( '.spoilers-show' ).show();
    $( this ).children( '.spoilers-hide' ).hide();
});
$( '.spoilers-button .spoilers-show' ).click( function() {
 
    $( this ).parents( '.spoilers' ).find( '.spoilers-body' ).show();
    $( this ).children( '.spoilers-show' ).hide();
    $( this ).children( '.spoilers-hide' ).show();
});
$( '.spoilers-button .spoilers-hide' ).click( function() {
 
    $( this ).parents( '.spoilers' ).find( '.spoilers-body' ).hide();
    $( this ).children( '.spoilers-show' ).show();
    $( this ).children( '.spoilers-hide' ).hide();
});