From 756f0fa75c7d8e18188dffdfbdd4416651dca9fe Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sat, 30 Jun 2018 10:03:15 +0200 Subject: Première maquette 2007-02-03+09:05:40 - 2007-02-03+22:31:43 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maquette_old/script old.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 maquette_old/script old.js (limited to 'maquette_old/script old.js') diff --git a/maquette_old/script old.js b/maquette_old/script old.js new file mode 100644 index 0000000..be5b113 --- /dev/null +++ b/maquette_old/script old.js @@ -0,0 +1,36 @@ +function pop() +{ + + var myAs = document.getElementsByTagName('a'); + for (var a = 0; a < myAs.length; ++a) { + // Si le lien a une classe de type pop + if (myAs[a].className == 'pop') { + // on extrait l'id de la popup à partir du href + var pop = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1)); + // si la popup existe on l'affiche (display block) + if (pop) { + pop.style.display = 'none'; + myAs[a].onclick = function() { + thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1)) + thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none'; + return false; + }; + // on efface la popup en cliquant dessus + // pop.onclick = function() + // { + // this.style.display = 'none'; + // }; + var nompopup = myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1); + var num = nompopup.substring(3,nompopup.length); + var nomform = 'form' + num; + var formulaire = document.getElementById(nomform); + if (formulaire) { + document.forms[nomform].elements['fermer'].onclick = function() { + pp = document.getElementById(('pop') + this.alt); + pp.style.display = 'none'; + } + } + } + } + } +} \ No newline at end of file -- cgit v1.2.3