<span class="mw-page-title-namespace">Template</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Pan</span>
Fabrice P. Lauss𝕪’s ℤetetic Web

A picture much wider than tall, shown across the white content area at a chosen height and moved with the mouse: press and drag, and the picture follows the pointer. There is no scrollbar. Ctrl+wheel over the picture zooms about the pointer, as does a pinch on a trackpad, from the whole picture fitting the width up to four screen pixels per pixel of the file; once zoomed in, the picture drags up and down too, and the original file replaces the thumbnail for the detail. A plain wheel still scrolls the page. Once the picture has been dragged, or reached with Tab, the keys +, − and 0 (back to the start) also work, as do the arrow keys; a finger, Shift+wheel or a trackpad swipe move it too. It opens centred on the middle of the picture. A click that does not move opens the file itself, which the browser displays and zooms by its own rules—no lightbox. The grip in the bottom right corner, as on the edit box, resizes the frame: drag it up to trim the view, down to open it, as far as the picture reaches at its present zoom—so zoom in, then pull the corner down to see more of it. In the left-hand margin, reading upwards beside the foot of the picture, a small italic Browsable says all this in its tooltip; it shows only where the window leaves the margin room for it (860px and wider). All this is done by MediaWiki:Gadget-pan.js; without JavaScript the box keeps a scrollbar instead, and the margin word does not appear. Version 1.8.

Parameter Meaning
1 the file name, with or without File:
h (or 2) the height: full (default, the file's own height, so one pixel of the picture per pixel of screen), half, third, quarter, a fraction such as 0.4, a size in pixels such as 300 or 300px, or fit to shrink the whole picture into the box with no scrolling (the same as [[File:x|full]])
caption (or 3) an optional caption under the box
zoom the zoom it opens at, in Ctrl+wheel notches from the height given: zoom=-7 opens it seven notches out; zoom=fit opens on the whole picture across the box. The frame keeps the height given, so zooming back in fills it again
tip a <wz> tooltip on the picture (a <wz> written around {{pan}} would hold nothing: MediaWiki moves the box out of it)
{{pan|Skeleton-lin-wide-w0.3-0OdQd.png}}
{{pan|Skeleton-lin-wide-w0.3-0OdQd.png|half}}
{{pan|Skeleton-lin-wide-w0.3-0OdQd.png|h=250px|caption=The skeleton, linear scale}}

The box runs the whole white area (778px), bleeding through the 20px page padding on both sides as full does; a picture narrower than that at the chosen height is centred and does not scroll. The height is asked of MediaWiki as xNpx, so the thumbnail is made at that size (with 1.5× and 2× versions for sharp screens), never larger than the file. The work is done by Module:Pan; the styles are in Template:Pan/styles.css.

Example, the Alhambra at 250px:

Browsable
The Alhambra, 24 December 2017