I am trying to make a "interactive business card" as my design course calls it, and i want to make a piano with playable buttons. The problem is that no matter what i try, the sound won't play in any browser. I startet out with linking the sound to one of the buttons in javascript/jQuery (i am pretty new to both languages, so i can not exactly say that i know what i am doing.) but now i just want to hear the sound, so i incorporated it into my html document.
Here is the code:
<!Doctype html>
<html>
<head> <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<h1>"Yo Dawg, i heard you like muzic."</h1>
<p>"hej"</p>
</head>
<body>
<div id= "wholething">
<div id= "whitekey1">
<div id= "blackkey2"></div></div>
<div id= "whitekey2">
</div>
<div id= "whitekey1">
<div id="blackkey3"></div>
</div>
<div id= "whitekey3">
<div id = "blackkey2"></div>
</div>
<div id= "whitekey4">
<div id = "blackkey2"></div>
</div>
<div id= "whitekey1">
<div id = "blackkey2"></div>
</div>
<div id= "whitekey3"></div>
<div id= "whitekey2">
<div id = "blackkey1"></div>
</div>
<div id= "whitekey4">
<div id = "blackkey1"></div>
</div>
<div id= "whitekey1">
<div id = "blackkey2"></div>
</div>
</div>
<script type= "text/javascript" src= "jquery-1.11.2.js"></script>
<script type= "text/javascript" src="script.js"></script>
<span id="dummy"></span>
<p><a href="#" onclick="playSound('afrique-kissingmylove.wav');">Click here to hear a bird sing</a></p>
<p onmouseover="playSound('afrique-kissingmylove.wav');">Or you can put your mouse over this paragraph to hear the same bird sound.</p>
</body>
What am i doing wrong? how do i make the sound play when you press the black and white keys? (preferably using javascript/jQuery.)
Aucun commentaire:
Enregistrer un commentaire