Cerco una popup che si apra automaticamente all'apertura della home page e che sia possibilmente centrata rispetto a quest'ultima.Grazie
Cerco una popup che si apra automaticamente all'apertura della home page e che sia possibilmente centrata rispetto a quest'ultima.Grazie
Ciao
Popuop centrata nel frame o pagina che contiene il JS
<script language="JavaScript">
<!--
function centra(url, width, height) {
if (document.all) {
var x = window.screenLeft;
var y = window.screenTop;
var w = window.document.body.offsetWidth;
var h = window.document.body.offsetHeight;
}
else {
var x = window.screenX;
var y = window.screenY;
var w = window.outerWidth;
var h = window.outerHeight;
}
var cntx = x + Math.round((w - width) / 2);
var cnty = y + Math.round((h - height) / 2);
window.open (url, null, 'left=' + cntx + ',top=' + cnty + ',width=' +
width + ',height=' + height +',scrollbars=1');
}
//-->
</script>
LINK
Centrata rispetto allo chermo:
<script language="JavaScript">
<!--
function centra(url, width, height) {
var cntx = (screen.width - width) / 2;
var cnty = (screen.height - height) / 2;
window.open(url, 'null', 'left=' + cntx + ',top=' + cnty + ',width=' + width + ',height=' + height +',scrollbars=1');
}
//-->
</script>
LINK
Massimo
Grazie ma la popup che cerco deve aprirsi automaticamente all'apertura della homepage!
Proprio nessuno sa fornirmi di questa popup?![]()
Ciao
<script language="JavaScript">
<!--
function centra(url, width, height) {
if (document.all) {
var x = window.screenLeft;
var y = window.screenTop;
var w = window.document.body.offsetWidth;
var h = window.document.body.offsetHeight;
}
else {
var x = window.screenX;
var y = window.screenY;
var w = window.outerWidth;
var h = window.outerHeight;
}
var cntx = x + Math.round((w - width) / 2);
var cnty = y + Math.round((h - height) / 2);
window.open (url, null, 'left=' + cntx + ',top=' + cnty + ',width=' +
width + ',height=' + height +',scrollbars=1');
}
//-->
</script>
<body onload="centra('http://www.libero.it/','200','200')">
Centrata rispetto allo chermo:
<script language="JavaScript">
<!--
function centra(url, width, height) {
var cntx = (screen.width - width) / 2;
var cnty = (screen.height - height) / 2;
window.open(url, 'null', 'left=' + cntx + ',top=' + cnty + ',width=' + width + ',height=' + height +',scrollbars=1');
}
//-->
</script>
<body onload="centra('http://www.libero.it/','200','200')">
Massimo