Mettere immagine per chiudere popup

di Anonimizzato11975 il
1 risposte
Ho messo il codice che richiama un immagine in modo che cliccandoci su dovrebbe chiudere il popup, ma non va. Prima al posto dell'immagine avevo il testo Close e funzionava.

<a href="#" onclick="body.style.overflow='auto';document.getElementById('shade').style.display='none';document.getElementById('chiudi-Scrivimi1').style.display='none';document.getElementById('popup-Scrivimi1').style.display='none'"><img src="chiudi.png" width="10%" height="10%" alt="Close" title="Close"></a></div>  

1 Risposte

  • <a href="#" onclick="body.style.overflow='auto';document.getElementById('shade').style.display='none';document.getElementById('chiudi-Scrivimi1').style.display='none';document.getElementById('popup-Scrivimi1').style.display='none'"><img src="immagini/close.png" width="25" height="25" alt="Close" title="Close"></a>  
    CSS
    #shade {
        position: fixed;
        background-color: rgba(0,0,0,0.3);
        width: 100%;
        height: 100%;
        margin: 0 auto;
        display: none;
        z-index: 1;
    }
    
    #popup-Scrivimi1 { 
        position: absolute;
        width: 410px; 
        height: 345px; 
        top: 50%;
        left: 50%; 
        margin-left: -205px;  /*metà della width*/
        margin-top: -172px;  /*metà della height*/
        display: none;  
        z-index: 2;
    }
    
    #chiudi-Scrivimi1 {    
        position: absolute; 
        top: -15px;
        left: 30px; 
        width: 30px;
        height: 25px;
        text-align: center;
        display: none;
        z-index: 2;
    }
    Clicca su @Email che lo vedi all'opera http://www.photoman.altervista.or
Devi accedere o registrarti per scrivere nel forum
1 risposte