<script type = "text / javascript">
fonction toggle () {) {
theObj = document.getElementByid ('sunyanzi').
If (theobj.display == "Aucun") theobj.display = "block"; else theobj.display = "Aucun";
}
</cript>
<div id = "sunyanzi" style = "affichage: aucun"> Vous me voyez apparu ~~~ </div>
<br />
<entrée type = "bouton" onclight = "toggle ()" value = "essayez de voir ...?"
Deux méthodes: supprimer et masquer
// Créez votre couche pop -up
var dvmsg = document.CreateElement ("div");
strhtml = "<div class = '####'> pop -up Couche Content </div>" "
Strhtml + = "<div class = '####'> <input type = 'bouton' value = 'sot off' onclick = 'btnclick ()'> </div>"
dvmsg.innerhtml = strhtml;
Document.Body.ApendChild (DVMSG);
// Fermez le bouton
btnclick = function () {{
document.body.removechild (DVMSG);
---------------------------
Ou la couche pop -up est marquée d'un id div
<div id = "tanchu"> contenu de la couche pop -up </div>
en js
fonction open () {
document.getElementByid (tanchu) .style.display = "" "; // affichage
}
Fonction close () {) {
document.getElementById (tanchu) .style.display = "Aucun";
}