Salut!
Je voudrais savoir quel est le code pour faire un spoiler comme ceci:
http://forum.hardware.fr/hardwarefr/JeuxVideo/Ouverture-facile-aides-pour-passer-niveaux-Lire-post-sujet-86813-2.htm
Mais pas sur un forum
Merci
<div style="margin:20px; margin-top:5px"><div class="quotetitle"><b>Spoiler:</b> <input type="button" value="Afficher" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Cacher'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Afficher'; }" /></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>
<div class="c1" onclick="javascript:montrer_spoiler('spoiler2')"><strong>spoiler</strong>
<script type="text/javascript">
function montrer_spoiler(value){var actual=document.getElementById(value).style.visibility;if (actual=='visible'){document.getElementById(value).style.visibility='hidden';}else{document.getElementById(value).style.visibility='visible';}} </script>
<dl style="visibility: hidden;" id="spoiler2">
<dd>texte c<br>
</dd>
</dl>
</div> ou lui
<div class="c1"
onclick="pchild=this.getElementsByTagName('p'); if(pchild[0].style.visibility!='hidden'){pchild[0].style.visibility='hidden'; pchild[0].style.height='0';}else{pchild[0].style.visibility=''; pchild[0].style.height=''}">Spoiler
<p style="">texte<br>
cach<br>
cach<br>
cach<br>
</p>
</div><div class="c1" onclick="javascript:montrer_spoiler('spoiler2')"><strong>spoiler</strong>
<script type="text/javascript">
function montrer_spoiler(value){var actual=document.getElementById(value).style.visibility;if (actual=='visible'){document.getElementById(value).style.visibility='hidden';}else{document.getElementById(value).style.visibility='visible';}} </script>
<dl style="visibility: hidden;" id="spoiler2">
<dd>texte c<br>
</dd>
</dl>
</div>
<script type="text/javascript">
function montrer_spoiler(value) {
var actual=document.getElementById(value).style.visibility;
if (actual=='visible') {
document.getElementById(value).style.visibility='hidden';
} else {
document.getElementById(value).style.visibility='visible';
}
}
</script>
<div class="container"><table class="spoiler" onclick="javascript:montrer_spoiler('spoiler2')" style="cursor: pointer;"><tbody><tr class="none"><td><b class="s1Topic">Spoiler :</b><br><br><div class="Topic masque" id="spoiler2">{TEXT}
</div></td></tr></tbody></table></div>
<div class="container"><table class="spoiler" onclick="javascript:montrer_spoiler('spoiler2')" style="cursor: pointer;"><tbody><tr class="none"><td><b class="s1Topic">Spoiler :</b><br><br><div class="Topic masque" id="spoiler2"><p>escargot</p></div></td></tr></tbody></table></div>
function montrer_spoiler(value) {
var actual=document.getElementById(value).style.visibility;
if (actual=='visible') {
document.getElementById(value).style.visibility='hidden';
} else {
document.getElementById(value).style.visibility='visible';
}
}
Vous n'aimez pas le lifting de Facebook ? Le site Mashable propose cinq étapes pour revenir à l'ancienne présentation du réseau social.
Tu trouveras une illustration sur cette page.
http://dieurdieuf.blogspot.com/2009/07/attention-sur-msn.html
Voici le code utilisé.
<div style="margin: 5px 20px 20px;"><div class="quotetitle"><b>Spoiler : </b> <input value="Afficher" style="margin: 0px; padding: 0px; width: 50px; font-size: 10px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Cacher'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Afficher'; }" type="button"></div><div class="quotecontent"><div style="display: none;"> <a href="http://yfrog.com/bglivemessengerj" target="_blank"><img style="width: 201px; height: 115px;" src="http://img412.imageshack.us/img412/415/livemessenger.jpg" border="0" alt="Attention" /></a> </div></div></div>Il faut remplacer la partie en gras par le texte, image ou média que tu souhaites afficher en spoiler.
Bonne journée.