1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| var popup;
function Affiche_figure( grandeImage, texte ) {
if (popup && !popup.closed)
popup.close();
popup = window.open('', '_blank', 'toolbar=0,location=0,menuBar=0,scrollbars=0,resizable=0');
var doc = popup.document;
doc.title = 'Image';
var $body = popup.document.body;
$body.style.margin = '0';
$body.oncontextmenu = function() { return false };
// var $center = doc.createElement('center');
// $body.appendChild($center);
$body.style.textAlign = 'center';
var $a = doc.createElement('a');
// $center.appendChild($a);
$body.appendChild($a);
$a.href = '#';
$a.onclick = function() {
popup.close();
return false;
}
var $img = doc.createElement('img');
$a.appendChild($img);
$img.style.border = 'none';
$img.src = grandeImage;
$img.alt = texte;
$img.onload = function() {
popup.resizeTo(this.width + 20, this.height + 80);
popup.moveTo((screen.width - this.width) / 2, 5);
}
popup.onblur = popup.close;
} |
Partager