Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Finestra modale

  1. #1
    Utente di HTML.it L'avatar di fab_
    Registrato dal
    Apr 2011
    Messaggi
    2

    Finestra modale

    Un saluto a tutti,
    avrei una domanda/richiesta da porvi: ho provato a creare una pagina php con finestra modale; quest'ultima risulta perfettamente funzionante in mozzilla, ma con internet explorer no.
    Essendo tecnicamente un novizio, vorrei sapere se e cosa potrei aver sbagliato.

    La pagina è QUESTA, mentre il file javascript è QUESTO.
    Di seguito i codici che ho usato nel corpo della pagina php:
    Codice PHP:
    <html><head>

    <
    style type="text/css">

    #fade {
        
    displaynone;
        
    background#000; 
        
    positionfixedleft0top0
        
    z-index10;
        
    width100%; height100%;
        
    opacity.80;
        
    z-index9999;
    }
    .
    popup_block{
        
    displaynone;
        
    background#fff;
        
    padding20px;     
        
    border20px solid #ddd;
        
    floatleft;
        
    font-size1.2em;
        
    positionfixed;
        
    top50%; left50%;
        
    z-index99999;
        -
    webkit-box-shadow0px 0px 20px #000;
        
    -moz-box-shadow0px 0px 20px #000;
        
    box-shadow0px 0px 20px #000;
        
    -webkit-border-radius10px;
        -
    moz-border-radius10px;
        
    border-radius10px;
    }
    img.btn_close {
        
    floatright
        
    margin: -55px -55px 0 0;
    }
    .
    popup p {
        
    padding5px 10px;
        
    margin5px 0;
    }
    /*--Making IE6 Understand Fixed Positioning--*/
    *html #fade {
        
    positionabsolute;
    }
    *
    html .popup_block {
        
    positionabsolute;
    }
    </
    style>

    </
    head>

    <
    body>

    <
    script type="text/javascript" src="css/jquery.js"></script>

    <script type="text/javascript">
    $(document).ready(function(){
                                          
        //When you click on a link with class of poplight and the href starts with a # 
        $('a.poplight[href^=#]').click(function() {
            var popID = $(this).attr('rel'); //Get Popup Name
            var popURL = $(this).attr('href'); //Get Popup href to define size
                    
            //Pull Query & Variables from href URL
            var query= popURL.split('?');
            var dim= query[1].split('&');
            var popWidth = dim[0].split('=')[1]; //Gets the first query string value

            //Fade in the Popup and add close button
            $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('[url="#"][img]close_pop.png[/img][/url]');
            
            //Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css
            var popMargTop = ($('#' + popID).height() + 80) / 2;
            var popMargLeft = ($('#' + popID).width() + 80) / 2;
            
            //Apply Margin to Popup
            $('#' + popID).css({ 
                'margin-top' : -popMargTop,
                'margin-left' : -popMargLeft
            });
            
            //Fade in Background
            $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
            $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer 
            
            return false;
        });
        
        
        //Close Popups and Fade Layer
        $('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
              $('#fade , .popup_block').fadeOut(function() {
                $('#fade, a.close').remove();  
        }); //fade them both out
            
            return false;
        });

        
    });
    </script>


            [url="#?w=500"]FINESTRA MODALE[/url]




    <div id="popup1" class="popup_block">

    blablabla

    </div>




    </body></html> 

  2. #2
    Utente di HTML.it L'avatar di m4rko80
    Registrato dal
    Aug 2008
    residenza
    Milano
    Messaggi
    2,655
    Ciao, ho provato ora con IE9 ie retro compatibilità , funziona! hai già sistemato forse?

  3. #3
    Utente di HTML.it L'avatar di fab_
    Registrato dal
    Apr 2011
    Messaggi
    2
    Tutto bene ragazzuoli, sono riuscito a venirne a capo.
    Avevo dimenticato di inserire un paio di stringhe nel file .css.
    Errore mio, ma grazie mille del supporto!

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.