riCiao :gren:
tipo così
codice:
<script LANGUAGE="JavaScript">
var foto1
var erTesto
function PrevFoto(img,testo){
foto1= new Image();
foto1.src=(img);
erTesto=testo
Controlla(img);
}
function Controlla(img){
if((foto1.width!=0)&&(foto1.height!=0)){
viewFoto(img);
}
else{
funzione="Controlla('"+img+"')";
intervallo=setTimeout(funzione,20);
}
}
function viewFoto(img){
largh=foto1.width+20;
altez=foto1.height+25;
stringa="width="+largh+",height="+altez;
Popup(img,largh,altez)
}
function Popup(apri,w,h) {
var l = Math.floor((screen.width-w)/2);
var t = Math.floor((screen.height-h)/2);
html = '<html><head></head><body><table width="100%"><tr><td>[img]'+apri+'[/img]</td></tr>'
if(erTesto!=''){
html+= '<tr><td align="center">'+erTesto+'</td></tr>'
h+=40
}
html+='</table></body>'
ww = window.open("","","width=" + w + ",height=" + h + ",top=" + t + ",left=" + l, "scroll: 1");
ww.document.write(html)
}
</script>