allora
nella pagina che chiama la pop-up metti
codice:
function apri(url_foto,des_foto){
addr="PopUp.asp?"+url_foto+"&"+escape(des_foto)
alt=150
lar=150
rszb=(document.layers)?1:0;
props='height='+alt+',width='+lar+',top='+parseInt((screen.availHeight-alt)/2)+',left='+parseInt((screen.availWidth-lar)/2)+',scrollbars=0,resizable='+rszb+',toolbar=0,menubar=0,location=0,status=0';
window.open(addr,'_blank',props);
}
dove url_foto è la path, des_foto la sua descrizione
nella pagina popup.asp metti
codice:
<html>
<head>
<script language="javascript" type="text/javascript">
// se vuoi dare dei margini alla foto cambia questi 2 valori
w_add=0;
h_add=0;
ww=0;
hh=0;
OP=(window.opera)?1:0;
timer=false;
if(location.search) {
addr=location.search.substr(1);
addr=addr.split('&');
document.write('<title>'+unescape(addr[1])+'<\/title>');
}
b_w=function() {return ((window.innerWidth)?window.innerWidth:document.body.clientWidth)}
b_h=function() {return ((window.innerHeight)?window.innerHeight:document.body.clientHeight)}
rsz=function() {self.resizeTo(ww,hh)}
function init() {
ww=b_w()
hh=b_h()
rsz()
ww2=b_w()
hh2=b_h()
w_add+=(ww-ww2)
h_add+=(hh-hh2)
ridimensiona()
}
function ridimensiona(){
var w_pix=(OP)?document.getElementById('pix').width:document.pix.width
var h_pix=(OP)?document.getElementById('pix').height:document.pix.height
if(w_pix>28 && h_pix>30){
ww=w_pix+w_add
hh=h_pix+h_add
y_coord=((screen.availHeight-hh)<0)?0:parseInt((screen.availHeight-hh)/2)
x_coord=((screen.availWidth-ww)<0)?0:parseInt((screen.availWidth-ww)/2)
rsz()
self.moveTo(x_coord,y_coord)
self.focus()
if (OP && !timer) {
w_tmp=b_w(); h_tmp=b_h();
timer=setInterval('if(w_tmp!=window.innerWidth || h_tmp!=window.innerHeight){self.location.reload(true)}',1000)
}
}
else setTimeout('ridimensiona()',1000)
}
</script>
</head>
<body onload="init()" onresize="ridimensiona()" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 style="overflow:hidden" bgcolor=white>
<script language="javascript" type="text/javascript">
// se hai dato dei margini decommenta la riga qui sotto
// document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%"><tr><td align="center" valign="middle">');
document.write('[img]'+addr[0]+'[/img]');
// se hai dato dei margini decommenta la riga qui sotto
// document.write('<\/td><\/tr><\/table>');
</script>
</body>
</html>
ciao!