diff --git a/javascript/004-duck.html b/javascript/004-duck.html index 9c3c7ad..fe6d02b 100644 --- a/javascript/004-duck.html +++ b/javascript/004-duck.html @@ -8,6 +8,7 @@ +
Kwak!
diff --git a/javascript/006-linamp.html b/javascript/006-linamp.html new file mode 100644 index 0000000..3299070 --- /dev/null +++ b/javascript/006-linamp.html @@ -0,0 +1,19 @@ + + + + + Linamp + + + + + + + + + + + + + + diff --git a/javascript/006-linamp.js b/javascript/006-linamp.js new file mode 100644 index 0000000..556e445 --- /dev/null +++ b/javascript/006-linamp.js @@ -0,0 +1,15 @@ +var track = document.getElementById("track"); +var playButton = document.getElementById("btn-play"); +var pauseButton = document.getElementById("btn-pause"); +var stopButton = document.getElementById("btn-stop"); + +playButton.addEventListener("dblclick", play); +pauseButton.addEventListener("click", pause); +stopButton.addEventListener("click", stop); + +function play() { track.play(); } +function pause() { track.pause(); } +function stop() { + pause(); + track.currentTime = 0; + } diff --git a/media/beethoven-symphony-5.mp3 b/media/beethoven-symphony-5.mp3 new file mode 100644 index 0000000..455e7c6 Binary files /dev/null and b/media/beethoven-symphony-5.mp3 differ