This script was inspired by La miniature et son popup, by pym.
When the thumbnail option is activated, a picture inserted into the article as a document has a link that opens the original full-size picture into a blank window.
This script allows to open the original picture by a rollover effect : the thumbnail changes to its full-size picture. The rest of the article is unchanged, excepted the page setup which is adapted to the size of the active picture.
How to install?
- unzip one of the files attached to the French version of this article depending of the SPIP version you are using, then open survol.php3  in a text editor
- copy/paste the function “survol”:
- either into mes_fonctions.php3 which is located at the root directory of your site (SPIP 1.8)
- or into mes_fonctions.php which is located in the /squelettes directory (SPIP 1.9)
How to use it?
Apply the filter “survol” to the text in the article template (article.html): replace
Have a look at this page, where you can notice the behaviour of pictures inserted as documents with their thumbnails.
How does it work?
The script searches for every thumbnail, which comprises of an img tag preceded by a link to another picture (jpg, png or gif type):
<a href=""><img src=""></a>. It replaces this string by a single img tag (
<img src="" onmouseout="" onmouseover="">) which includes a rollover: the thumbnail is used as “onmouseout” picture whereas full-size picture is used as “onmouseover”.
- tested for SPIP 1.8.2, 1.9.1 and 1.9.2
- only applies to pictures that were inserted in the article as documents, by the mean of a doc tag (example: