









Ce script va vous permettre d'adapter la fenêtre du navigateur à une image tout en plaçant cette fenêtre au milieu de l'écran.
function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+6,document.images[0].height+32); if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; windowWidth = window.innerWidth; } else { windowHeight = document.body.clientHeight; windowWidth = document.body.clientWidth; } var top=(screen.height-windowHeight)/2; var left=(screen.width-windowWidth)/2; window.moveTo(left,top); window.focus(); } else { setTimeout('checksize()',250) } }
Vous n'aurez plus qu'a mettre dans la balise body onload=“checksize();”
— maniT4c 31/03/2006 16:00