SPIP-Contrib

SPIP-Contrib

عربي | Deutsch | English | Español | français | italiano | Nederlands

289 Plugins, 197 contribs On SPIP-Zone, 88 visitors now

Home > Media > Pictures > Images processing > Image Zoom > A Magnifier for the Thumbnails

A Magnifier for the Thumbnails

5 October 2008 – by mortimer

All the versions of this article: [English] [français]

0 vote

The default SPIP image insertion shortcut displays only a small version of the image. The imagezoom plugin adds a little zoom window to display details of the thumbnail by using the large version of the image for magnification.

This plugin provides a new model to display a magnifier on an image for localised zoom: <imgXX|zoom>.

The configuration page allows to choose a different style for the magnifier window or specify your own personal style. See the end of this article for styling options.

The code is based on the TJPZoom library by Jànos Tòth.

The plugin will only work with templates using the #INSERT_HEAD tag.

If you use SPIP 1.9.2, you need to download the javascript library from TJPZoom and put its content in a directory tjpzoom in the squelettes directory. If you use SPIP 2, this is done automatically.

Using the Magnifier

The magnifier is activated as soon as the mouse enters the thumbnails. If the original image is very large, a “loading...” message will appear while it loads.

By click and dragging up and down on the image, you can change the magnification level of the zoom.

By click and dragging left/right, you can change the size of the zoom window.

Model Option

The <imgXX|zoom> model can be aligned left and right with <imgXX|zoom|right> et <imgXX|zoom|left>. However, unlike the default img model, this does not float the text around the image.

The maximum width of the thumbnail can be specified globally from the configuration page or locally with the parameter: <imgXX|size=340>

Personalised Magnifier Style

The configuration of the style can be done through a javascript file named tjpzoom_config_XXXX.js and placed in the directory squelettes.

The file defines the following variables:

Configuration Variables
variableuse
var TJPzoomwidth=160; width of the zoom window.
var TJPzoomheight=120; height of the zoom window.
var TJPzoomwindowlock=0; if this variable is equal to 1, the window size is fixed.
var TJPzoomoffsetx=.5; horizontal offset of the zoom window to the mouse pointer. 0.5 puts the pointer in the center of the zoom window.
var TJPzoomoffsety=.5; vertical offset of the zoom window to the mouse pointer. 0.5 puts the pointer in the center of the zoom window.
var TJPzoomamount=4; initial zoom level.
var TJPzoomamountmax=12; maximum zoom level.
var TJPzoomamountmin=1; minimum zoom level.
var TJPborderthick=2; width of the zoom border.
var TJPbordercolor='#cccccc'; colour of the border.

In addition to these parameters, you can specify an image for the the border of the zoom window. To personalise this border, you have to create a directory
XXXX in the squelettes folder with eight png images for the border and corners:
n.png, ne.png, e.png, se.png, s.png, sw.png, w.png, nw.png.

You also have to add the configuration variable var TJPshadowthick=8; to specify the half width of the border.

updated on 13 June 2012

Back to top

Comment on this article

Who are you?
  • [Log in]

To show your avatar with your message, register it first on gravatar.com (free et painless) and don’t forget to indicate your Email addresse here.

Enter your comment here Les choses à faire avant de poser une question (Prolégomènes aux rapports de bugs. )
Add a document

Back to top

Here they're talking

  • (fr) Escal-V3 et Escal-V4

    16 février 2012 – 314 commentaires

    Un jeu de squelettes proposant un affichage en 2 ou 3 colonnes avec un large choix de noisettes à insérer ou pas, fortement paramétrable depuis l’espace privé. Présentation A l’instar de sa petite soeur plugin Escal-V2 dont elle reprend toutes les (...)

  • (fr) SPIP-Cli

    20 décembre 2015 – 13 commentaires

    SPIP-Cli est une interface en ligne de commande pour SPIP. SPIP-Cli sert à interagir avec SPIP depuis la ligne de commande, à la fois avant d’avoir un SPIP sous la main (installation, configuration…), puis ensuite pour administrer ou modifier un (...)

  • (fr) Plugin Google Viewer

    22 mai 2011 – 34 commentaires

    Ce plugin fournit des modèles d’incrustation de documents utilisant le lecteur de documents de Google. Principe Ce plugin permet d’utiliser le lecteur de documents de Google pour incruster des documents dans vos textes. L’ensemble des (...)

  • (fr) Social tags

    8 septembre 2008 – 444 commentaires

    Le plugin Social Tags permet d’ajouter des icônes de partage de liens vers les sites tels que Digg, Facebook, Delicious.... Une fois le plugin installé et activé (voir doc.), le choix des sites se fait via un menu de configuration. Insertion (...)

  • (fr) LESS pour SPIP : Less-CSS (anciennement LESSpip)

    5 novembre 2010 – 51 commentaires

    Less-CSS (Anciennement LESSpip) est un plugin intégrant facilement le logiciel LESS dans SPIP. LESS est une extension de CSS ajoutant les variables, les classes, les opérations, les imbrications au langage. Facilitant ainsi l’écriture de feuilles (...)