Hallo Gemeinde!
Wie kann ich ein Popup-Fenster (start.html) auf dem Bildschirm zentrieren?
Ich habe folgenden Code:
index.html:
<html>
<head>
<title>something weird</title>
<script type="text/javascript">
<!--
sw = (screen.width-680)/2;
sh = (screen.height-415)/2;
window.open('start.html','main','width=680,height=415,left=sw,top=sh,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
//-->
</script>
</head>
<body>
</body>
</html>
start.html: (hier nur zum Ausprobieren angegeben)
<html>
<head>
<title>Start</title>
</head>
<body background="Startpage.gif" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0">
blah blah blah
</body>
</html>
Ich habe auch probiert, (screen.width-680)/2 und (screen.height-415)/2 statt sw und sh in window.open zu benutzen. Hat aber ebensowenig funktioniert. Dabei muesste es doch so funktionieren, oder?
Vielen Dank fuer jede Hilfe!