Ragazzi devo posizionare una pagina html al centro, ho già un codice per farla aprire al centro, ma vorrei un codice da inserire direttamente nella pagina e non nel collegamento.
il codice che ho è questo
function openMain(){
var widthOfWindow = 1020;
var heightOfWindow = 250;
// set this to the URL you want to go to
var URL="fascia-con-mani.html";
// do not modify
//this.moveTo(0,0);
//this.resizeTo(screen.width, screen.height);
var giddyWindow = window.open('','','width=' + widthOfWindow + ',height=' + heightOfWindow + ',statusbar=no,scrollbars=NO');
var sX = (screen.width - widthOfWindow) / 2;
var sY = (screen.height - heightOfWindow) / 2;
giddyWindow.moveTo(sX,sY);
giddyWindow.document.location.href = URL;
}
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
e richiamo il tutto con
href="#" onClick="MM_callJS('openMain()')
grazie