MediaWiki:Common.js: Difference between revisions
From Legoktm
(slideshow magic) |
(.ready) |
||
Line 2: | Line 2: | ||
// Automatically progress through slideshow galleries |
// Automatically progress through slideshow galleries |
||
$( function () { |
|||
mw.hook( 'wikipage.content' ).add( function ( $content ) { |
|||
$content.find( '.mw-gallery-slideshow-buttons' ).each( function () { |
|||
var buttons = this; |
var buttons = this; |
||
setInterval( function() { |
setInterval( function() { |
||
buttons.firstChild.children[2].firstChild.click(); |
buttons.firstChild.children[2].firstChild.click(); |
||
}, 3000 ); |
}, 3000 ); |
||
} ); |
|||
} ); |
} ); |
||
} ); |
} ); |
Revision as of 07:45, 7 October 2020
/* Any JavaScript here will be loaded for all users on every page load. */
// Automatically progress through slideshow galleries
$( function () {
mw.hook( 'wikipage.content' ).add( function ( $content ) {
$content.find( '.mw-gallery-slideshow-buttons' ).each( function () {
var buttons = this;
setInterval( function() {
buttons.firstChild.children[2].firstChild.click();
}, 3000 );
} );
} );
} );