Javascript: Standard-Popup

Öffnet ein ganz normales, schicki-micki-loses Javascript-Popup und zentriert es auf dem Bildschrim.
<script type="text/javascript">
function OpenPopup(url, pwidth, pheight) {
  popup = window.open(url,
    "Win",
    "scrollbars=auto,status=no,toolbar=no,resizable=yes,location=no,menu=no," +
    "width=" + pwidth + ",height=" + pheight + "," +
    "left=" + ((screen.width/2)-(pwidth/2)) + ",top="+ ((screen.height/2)-(pheight/2)));
  popup.focus();
}
</script>
Aufruf z.B.:
<a href="javascript:OpenPopup('http://google.de',600,300);">Popup öffnen</a>

JavaScript

April 2009 | Permalink | Feedback