Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    279

    Popup non funzionante se in frameset

    Ciao ragazzi come mai questo codice non funziona se la pagina che lo contiene e all'interno di un frameset?


    <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>





    grazie a tutti .... è urgente

  2. #2
    Utente di HTML.it
    Registrato dal
    Apr 2000
    Messaggi
    938
    Ciao


    Così come è impostato adesso la centra nel frameset dove si trova lo script


    Prova in questo modo

    <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

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.