Summary: Inline picture zoom for modern browsers and touch-screen devices
Version: 20210710
Status: Experimental
Maintainer: Petko
License: GPL+MIT
Users: +2 (view / edit)
Discussion: Maxi2-Talk?


Inline picture zoom for modern browsers and touch-screen devices.

This is a rewrite of the Maxi recipe. Maxi was written 12 years ago, when touch screen devices were rare and when browsers had a smaller reliable subset of common features.

Maxi2 allows for large pictures like panoramas, charts, scanned pages, engineering drawings to be embedded into a wiki page, and the visitors can zoom-in and zoom out by scrolling the mouse wheel, and by pinching on a touch screen. They can also drag the picture to move into the zoomed-in area.

Base view when the page is first opened

Base view when the page is first opened

User has zoomed on the boat near the center of the picture

User has zoomed on the boat near the center of the picture

Demo: test the recipe here.

This recipe makes use of CSS transforms for which recent browsers are optimized and rely on the GPU. The quality of the resized picture is usually very good. You can zoom in and out in several levels.


  1. Get maxi2.zipΔ (alt. download:
  2. Place the file maxi2.php in your pmwiki/cookbook directory, and the directory maxi2 in your pmwiki/pub directory.
  3. Add to config.php such a line:


To do.


In a wiki page, use the following markup on a new line:


If you have previously used Maxi, disable it and the new recipe will be able to reuse existing markup from your pages:


Note that the new recipe ignores the small picture, it only needs the large picture.


A mobile-friendly skin with the necessary meta viewport tag will make it easier to use on a mobile device.

To do / some day / maybe

Change log / Release notes

  • 20210710: Add "mouseout" event listener to stop dragging when the mouse leaves the region (in such cases the "mouseup" event didn't fire so the picture seemed locked to the mouse cursor).
  • 20210707a: Fix the order of the scripts was incorrectly swapped and could cause a JavaScript error on first load.
  • 20210707: First public release, ready to be tested.

See also

Cookbook /
Maxi  An image viewer with inline zoom, suitable for large drawings or panoramas (Experimental)


  • Recipe written and maintained by Petko.
  • The recipe relies on version 1.0.7 of the JavaScript library Zoom by Anita Vasu, with changes by Petko: corrections when the picture is not near the top of the page, extensions for mouse events, auto-loading functions, and integration into PmWiki.


See discussion at Maxi2-Talk?

User notes +2: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.