MediaWiki:Common.js: Difference between revisions
From Legoktm
(fix) |
(adjust time) |
||
Line 4: | Line 4: | ||
$( function () { |
$( function () { |
||
mw.hook( 'wikipage.content' ).add( function ( $content ) { |
mw.hook( 'wikipage.content' ).add( function ( $content ) { |
||
// Wait |
// Wait 10s for the gallery code to set up and run |
||
setTimeout( function () { |
setTimeout( function () { |
||
$content.find( '.mw-gallery-slideshow-buttons' ).each( function () { |
$content.find( '.mw-gallery-slideshow-buttons' ).each( function () { |
||
var buttons = this; |
var buttons = this; |
||
// Advance to new image every 10s |
|||
setInterval( function() { |
setInterval( function() { |
||
buttons.firstChild.children[2].firstChild.click(); |
buttons.firstChild.children[2].firstChild.click(); |
||
}, |
}, 10000 ); |
||
} ); |
} ); |
||
}, |
}, 10000 ); |
||
} ); |
} ); |
||
} ); |
} ); |
Revision as of 07:50, 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 ) {
// Wait 10s for the gallery code to set up and run
setTimeout( function () {
$content.find( '.mw-gallery-slideshow-buttons' ).each( function () {
var buttons = this;
// Advance to new image every 10s
setInterval( function() {
buttons.firstChild.children[2].firstChild.click();
}, 10000 );
} );
}, 10000 );
} );
} );