From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Translate this page; This page contains changes which are not marked for translation.

Gallery Slideshow is a gadget that provides JavaScript code to create a slideshow of the images within a category or in a gallery on a page in the Commons or (Gallery) namespaces. It is activated in your preferences by default.

Alternatively, you may continue to use the Media Viewer, to be set on Special:Preferences#mw-prefsection-rendering.

JavaScript is disabled in your browser.
Hover the slideshow button in order to see more options after activating the gadget

Keyboard navigation

Screenshot of Gadget-GallerySlideshow in Gallery-mode
  • Space: next image
  • End: last loaded image
  • : previous image
  • : next image
  • Break: play / pause (break) [Ctrl+C on Mac]
  • Esc: hide slideshow (press again to show it)

URL parameters

URL-Parameter allows you to post links, which can start a customized slideshow.

Example of a URL's construction:

List of parameters and possible values
  • gsAutoPlay Possible values: 1 or 0 — automatically starts playing after opening the slideshow.
  • gsDelay Possible values: number >2500 — sets the delay to wait before loading a new image.
  • gsDir Possible values: asc, desc — (direction)- starts the slideshow from the beginning or end.
  • gsContinue Possible values: valid Key — starts the slideshow from this key.
  • gsAutoStart Possible values: 1 or 0 — automatically opens the slideshow after page-loading.
  • gsReadFromScreen Possible values: 1 or 0 — sorting like displayed on the page; only images in gallery-boxes; loads only visible images in categories
  • withJS Possible values: MediaWiki:Gadget-GallerySlideshow.js — load script code for the slideshow; this is not necessary if you have it enabled in your preferences.
  • withCSS Possible values: MediaWiki:Gadget-GallerySlideshow.css — load style code for the slideshow; this is not necessary if you have it enabled in your preferences.


Custom settings

You can customize your slideshow in your common.js by adding the code below. Note that your settings can be overwritten by URL-parameters.

$(document).bind('slideshow', function(evt, st, x) {
	if (!st || !x) return;
	if ('starting' !== st) return;
	// The following lines are just examples.
	// You can remove a complete line to use the defaults or change the values
	x.autoPlay = true;   // same as gsAutoPlay but use only true or false
	x.delay = 10000;     // same as gsDelay
	x.cmdir = 'desc';    // same as gsDir but use only 'asc' or 'desc', NOT 0 or 1

	// number of days to save the position where you have left the slideshow
	x.lastPositionExpiry = 1; // -1 to delete the cookie when you close your browser (session-cookie)
	x.defaultTransitionDuration = 2000;

If you are a real hacker, you can search for var defaults = { in MediaWiki:GallerySlideshow.js. There is a complete list of defaults you can customize. If this is still not enough, GallerySlideshow fires a lot of events. Just search for $(document).triggerHandler('slideshow', (also in MediaWiki:Gadget-GallerySlideshow.js) You can listen to them using the approach above.


For convenience the slideshow stores some information in cookies:

  • The image you've last seen.
  • The delay you've last entered.

Cookies are often lost while logout or closing the browser. If so, don't blame me, look in your browser's settings.