Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- =========================
- AUDIO JAVASCRIPT
- ========================= -->
- <script type="text/javascript" src="js/soundmanager2.js"></script>
- <!-- configure SM2 for your use -->
- <script type="text/javascript">
- soundManager.setup({
- // location: path to SWF files, as needed (SWF file name is appended later.)
- url: '/path/to/swf-files/',
- // optional: version of SM2 flash audio API to use (8 or 9; default is 8 if omitted, OK for most use cases.)
- // flashVersion: 9,
- // use soundmanager2-nodebug-jsmin.js, or disable debug mode (enabled by default) after development/testing
- // debugMode: false,
- // good to go: the onready() callback
- onready: function() {
- // SM2 has started - now you can create and play sounds!
- var mySound = soundManager.createSound({
- id: 'book', // optional: provide your own unique id
- url: 'audio/book.wav'
- // onload: function() { console.log('sound loaded!', this); }
- // other options here..
- });
- var beep = soundManager.createSound({
- id: 'bleep', // optional: provide your own unique id
- url: 'audio/effect/bleep.wav'
- // onload: function() { console.log('sound loaded!', this); }
- // other options here..
- });
- var cheer = soundManager.createSound({
- id: 'cheer', // optional: provide your own unique id
- url: 'audio/effect/cheer.wav'
- // onload: function() { console.log('sound loaded!', this); }
- // other options here..
- });
- setTimeout(function () { mySound.play(); }, 3000);
- },
- // optional: ontimeout() callback for handling start-up failure
- ontimeout: function() {
- // Hrmm, SM2 could not start. Missing SWF? Flash blocked? No HTML5 audio support? Show an error, etc.?
- // See the flashblock demo when you want to start getting fancy.
- }
- });
- function cheer(){
- cheer().play;
- }
- function beep(){
- beep().play;
- }
- </script>
- <body>
- <center>
- <a href="#book" onclick="cheer()"><img class="heroshot wow bounceInUp" data-wow-duration="2s" src="img/book.png" width="15%"></a>
- <a href="#car" onclick="beep()"><img class="heroshot wow bounceInDown" data-wow-duration="3s" src="img/car.png" width="15%"></a>
- <a href="#cat" onclick="beep()"><img class="heroshot wow bounceInUp" data-wow-duration="2s" src="img/cat.png" width="15%"></a>
- <a href="#brain" onclick="beep()"><img class="heroshot wow bounceInDown" data-wow-duration="3s" src="img/brain.png" width="15%"></a>
- </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement