Attribuer un son a une alert (js)
Fermé
Chabanus
Messages postés
978
Date d'inscription
dimanche 23 décembre 2007
Statut
Membre
Dernière intervention
11 novembre 2011
-
1 déc. 2008 à 20:47
Chabanus Messages postés 978 Date d'inscription dimanche 23 décembre 2007 Statut Membre Dernière intervention 11 novembre 2011 - 2 déc. 2008 à 17:29
Chabanus Messages postés 978 Date d'inscription dimanche 23 décembre 2007 Statut Membre Dernière intervention 11 novembre 2011 - 2 déc. 2008 à 17:29
A voir également:
- Attribuer un son a une alert (js)
- Attribuer une sonnerie à un contact - Guide
- Attribuer une valeur à une cellule texte excel - Forum Excel
- Faire croire que son numero n'est plus attribué - Forum Bouygues Télécom
- Comment attribuer une sonnerie a une application - Guide
- Colombe souhaite utiliser cette image comme illustration. quel texte doit-elle ajouter pour attribuer correctement la photographie à son auteur ? - Forum Matériel & Système
3 réponses
Archeus01
Messages postés
1571
Date d'inscription
mercredi 3 octobre 2007
Statut
Membre
Dernière intervention
9 juin 2022
452
1 déc. 2008 à 21:55
1 déc. 2008 à 21:55
PHP est coté serveur... Donc c'est un code JS et google t'aidera.
Chabanus
Messages postés
978
Date d'inscription
dimanche 23 décembre 2007
Statut
Membre
Dernière intervention
11 novembre 2011
70
1 déc. 2008 à 23:19
1 déc. 2008 à 23:19
Merci pour ta réponse, mais avec google il faut placer les bons mots clés et les miens n'ont pas trop fonctionner, sinon voici ce que j'ai trouvé mais pour un son sur une page, comment l'intégrer a une alerte, aucune idée:
Cordialement
<?php $repertoire='./midi/'; $compteur=0; $handle=opendir($repertoire); while ($fichier = readdir($handle)) { if (strlen($fichier)>3) {$extension= strtolower(substr( strrchr( $fichier, "." ), 1 )); if ($extension=="mid") { $compteur++; $fichmidi[$compteur]=$fichier; } } } closedir($handle); if ($compteur>0) {srand((double)microtime()*1000000); $aleatoire=rand(1,$compteur); if (ereg("MSIE", $HTTP_USER_AGENT)) { echo "<bgsound src='$repertoire$fichmidi[$aleatoire]' LOOP=INFINITE>";} else { echo "<EMBED src='$repertoire$fichmidi[$aleatoire]' AUTOSTART=true HIDDEN=true loop=true></EMBED>";} } ?>
Cordialement
Archeus01
Messages postés
1571
Date d'inscription
mercredi 3 octobre 2007
Statut
Membre
Dernière intervention
9 juin 2022
452
2 déc. 2008 à 16:03
2 déc. 2008 à 16:03
Ton code php est plutot pour faire une liste de lecture, non?
J'ai trouvé ça
http://www.journaldunet.com/...
et ça
4. Controlling an Embedded Sound using JavaScript (New)
A minor variation on 3. is to use the JavaScript getElementById() function in the EvalSound definition. This is actually the preferred method for recent browsers, but is not supported by older versions. The function and the sound object then becomes:
<script>
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
</script>
<embed src="success.wav" autostart=false width=0 height=0 id="sound1"
enablejavascript="true">
Note that we specify name of the embedded sound using its ID attribute now. The function calls however are the same as above. For example:
<form>
<input type="button" value="Play Sound" onClick="EvalSound('sound1')">
</form>
extrait de http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
J'ai trouvé ça
http://www.journaldunet.com/...
et ça
4. Controlling an Embedded Sound using JavaScript (New)
A minor variation on 3. is to use the JavaScript getElementById() function in the EvalSound definition. This is actually the preferred method for recent browsers, but is not supported by older versions. The function and the sound object then becomes:
<script>
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
</script>
<embed src="success.wav" autostart=false width=0 height=0 id="sound1"
enablejavascript="true">
Note that we specify name of the embedded sound using its ID attribute now. The function calls however are the same as above. For example:
<form>
<input type="button" value="Play Sound" onClick="EvalSound('sound1')">
</form>
extrait de http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
Chabanus
Messages postés
978
Date d'inscription
dimanche 23 décembre 2007
Statut
Membre
Dernière intervention
11 novembre 2011
70
2 déc. 2008 à 17:29
2 déc. 2008 à 17:29
Merci je vais essayer