Dyskusja MediaWiki:Common.js
Kod
Mógłby jakiś administrator dodać poniższy kod do tej strony? Dzięki niemu w Infoboxach będzie można dodać kilka różnych obrazów i będą się one przełączać, tak jak na angielskiej wiki (+jeszcze MediaWiki:Common.css). Pozdrawiam ~ MatikTheSeventh (dyskusja) 19:48, 14 cze 2014 (UTC)
/**
* Element animator
*
* Will cycle the active class on any child elements
* within an element with the animated class.
* Script from: http://minecraft.gamepedia.com/
*/
window.mcw = {};
mcw.animation = function() {
if ( mcw.animate === undefined && $( '.animated' ).length ) {
mcw.animate = setInterval( function() {
$( '.animated' ).each( function() {
var $current = $( this ).children( '.active' ), $next = $current.nextAll( ':not(.skip):first' );
if ( !$next.length ) {
$next = $( this ).children( ':not(.skip):first' );
}
$current.removeClass( 'active' );
$next.addClass( 'active' );
} );
}, 2000 );
}
};
mcw.animation();