Visualizzazione dei risultati da 1 a 2 su 2

Discussione: popup auto e centrata?

  1. #1

    popup auto e centrata?

    CIAO
    problemino:
    devo aprire una popup in automatico all'apertura di una pagina, fin qui tutto OK, utilizzano il cod:

    <script language="Javascript">
    newwindow=window.open('nome_popup.htm', '', 'width=220,height=220,scrollbars=no')
    window.opener=self
    </script>

    mi servirebbe però che la popup venga aperta perfettamente centrata...
    cosa devo aggiungere?

    grazie
    Jo
    EH!! Quanti siete? Dove andate? Cosa portate? Un fiorino
    EH!! Quanti siete? Dove andate? Cosa portate? Un fiorino

  2. #2
    ce l'ho fatta!
    Vi posto il cod, se mai vi servisse

    </script>
    <script language="Javascript">
    var w = 300;
    var h = 300;
    var pw = Math.floor((screen.width-w)/2);
    var ph = Math.floor((screen.height-h)/2);
    newwindow=window.open("nome_popup.htm","","width=" + w + ",height=" + h + ",top=" + ph + ",left=" + pw)
    window.opener=self
    </script>

    Hola a todos
    EH!! Quanti siete? Dove andate? Cosa portate? Un fiorino
    EH!! Quanti siete? Dove andate? Cosa portate? Un fiorino

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.