Salut :)
JE vais me répété mais ca genera pas, je ne m'y connais strictement rien en javascript et la personne qui s'oqp du javascript sur mon site est absente (en vaccance). Mais la il y a un script pour joué des midis qui fonctionne pas correctement.
J'ai une listbox de midis qui est généré. Quand je suis sur l'index les midis se jouent bien, mais si je change de page, le midi se coupe. Il y a aussi le problème que les midis ne veulene tse joué que sur l'index (on ne peu pas joué de midis sur d'autres pages).
Bien sur c'est une question de cadre, mais je ne sais pas faire. :)
Voila le code :
<?
<script language="JavaScript1.2">
contenu_true="<a href=\"#\" onClick=\"javascript:select_ambiance.selectedIndex=0;changer_ambiance('Rien')\"><img src=\"http://www.diablus.com/img/son_true.gif\" width=\"20\" height=\"14\" border=\"0\"></a>";
function changer_ambiance(nom_ambiance) {
objet_ambiance=document.getElementById("span_ambiance"); //parent.Cadre_ambiance.document.getElementById("span_ambiance");
objet_image=document.getElementById("image_ambiance");
if(nom_ambiance=="Rien"){
objet_ambiance.innerHTML="";
Ambiance_rien.text="Ambiance :";
objet_image.innerHTML="<img src=\"http://www.diablus.com/img/son_false.gif\" width=\"20\" height=\"14\">";
} else {
objet_ambiance.innerHTML="<embed src=\"Autres/ambiances/"+nom_ambiance+"\" autostart=\"true\" loop=\"true\"></embed>";
Ambiance_rien.text="Stop";
objet_image.innerHTML=contenu_true;
}
//parent.Cadre_ambiance.ambiance_choisie=select_ambiance.selectedIndex;
}
</script>
<span id="span_ambiance"></span>
<span id="image_ambiance"><img src="http://www.diablus.com/img/son_false.gif" width="20" height="14" border="0"></span>
<select id="select_ambiance" style="background-color: #000000; color: #CC0000" onChange="changer_ambiance(this.value)">
<option value="Rien" id="Ambiance_rien" selected>Ambiance :</option>
<?
$ouverture=opendir("$DOCUMENT_ROOT/Autres/ambiances");
$fichier=readdir($ouverture);
$fichier=readdir($ouverture);
while ($fichier=readdir($ouverture)) { $liste[]=$fichier; }
closedir($ouverture);
sort($liste);
foreach ($liste as $fichier) echo " <option value=\"".$fichier."\">".htmlentities(substr($fichier, 0, strlen($fichier)-4))."</option>\n";
?>
</select>
<script language="JavaScript">
/*
ambiance_courante=parent.Cadre_ambiance.ambiance_choisie;
if (ambiance_courante!=0) {
select_ambiance.selectedIndex=ambiance_courante;
Ambiance_rien.text="Stop";
document.getElementById("image_ambiance").innerHTML=contenu_true;
}