A bare bones Javascript play button with no extra UI or complications
- Prepare some play/pause button images
- Set up the image sources in this JS file. Lines 28 - 30
- Customize the CSS, if desired. Line 48
- Insert the JS file at the bottom of your HTML:
<script src='BasicAudioButton.js'></script>
- Add your AudioButtons to your HTML as follows. (Use absolute filepaths or pausing won't work correctly.)
<img id='button1' class='audioButton' onclick='playAudio("http://www.cow.com/audio1.mp3", this.id);'>
<img id='button2' class='audioButton' onclick='playAudio("http://www.cow.com/audio2.mp3", this.id);'>
<img id='button3' class='audioButton' onclick='playAudio("http://www.cow.com/audio3.mp3", this.id);'>
Subpages at www.taylorcalderone.com/music