Bonjour, j'ai crée ce sujet car j'ai besoin d'aide pour mon script.
J'ai crée un truc pour Minimiser et Fermer un truc (Cacher/Afficher) Quand il y'en a un ca marche bien Et quand il y'en a deux la sa pose problème car le div 2 ferme le div 1 mais le div 2 ne se ferme jamais.Ca peux être superflu donc voici le code.
Code Javascript :
function divaffiche(){
document.getElementById("box_keywords").style.display = "block";
document.getElementById("cache").style.display = "inline";
document.getElementById("voir").style.display = "none";
}
function divcache(){
document.getElementById("box_keywords").style.display = "none";
document.getElementById("cache").style.display = "none";
document.getElementById("voir").style.display = "inline";
}
function divclose(){
document.getElementById("box_keywords").style.display = "none";
document.getElementById("box").style.display = "none";
document.getElementById("close").style.display = "none";
document.getElementById("cache").style.display = "none";
document.getElementById("voir").style.display = "none";
}
Et le HTML
Code HTML :
<div id="box">
<!-- [b][u]Boite 1 (Div1)[/u][/b] -->
<b class="box_title"><?php if (isset($box_name)) { echo $box_name; }else { echo "Sans titre";} ?></b>
<!--Close-->
<a id="close" onClick="divclose()" style="display:inline;"/>
<img align="right" src="images/button/close.gif" alt="Fermer" title="Fermer" id="close">
</a>
<!--Restore-->
<a id="voir" onClick="divaffiche()" style="display:none;"/>
<img align="right" src="images/button/restor.gif" alt="Restaurer" title="Restaurer">
</a>
<!--Minimize-->
<a id="cache" onClick="divcache()" style="display:inline;"/>
<img align="right" src="images/button/minimize.gif" alt="Minimiser" title="Minimiser">
</a>
<div id="box_keywords">
<p>5sdsd</p>
</div>
</div>
<div id="box">
[b][u]<!-- Boite 2 (Div2) -->[/u][/b]
<b class="box_title"><?php if (isset($box_name)) { echo $box_name; }else { echo "Sans titre";} ?></b>
<!--Close-->
<a id="close" onClick="divclose()" style="display:inline;"/>
<img align="right" src="images/button/close.gif" alt="Fermer" title="Fermer" id="close">
</a>
<!--Restore-->
<a id="voir" onClick="divaffiche()" style="display:none;"/>
<img align="right" src="images/button/restor.gif" alt="Restaurer" title="Restaurer">
</a>
<!--Minimize-->
<a id="cache" onClick="divcache()" style="display:inline;"/>
<img align="right" src="images/button/minimize.gif" alt="Minimiser" title="Minimiser">
</a>
<div id="box_keywords">
<p>5sdsd</p>
</div>
</div>
Merci de votre aide
J'ai vu ce script qui ma mit sur le chemin et qui marche très bien. Mais je voudrai garder mon script.
ici
Merci