If a button has a fixed value, I need a Javascript solution to play a specific sound
I Using jquery or javascript has not tried this kind of functionality. How can someone guide me?
Find a sound you like (for example).
Add a Check out this example: There are some good things that you can do, such as When you really want to play this audio element, then read the text of the button depending on you and compare it to "no" if you want. Sound Manager2 API makes it easy to use which allows sound played in any modern browser including IE 6+ The browser can be supported if the browser does not support HTML5. If you do not want hard HTML5 and no flash, then there is a setting for it, like Flash = false This iPad, iPhone (iOS 4) and other HTML5-enabled devices + 100% Supports Flash Free Audio Simples as Usage: Here's a demo in action: & lt; Audio & gt; Place the element
Receive your audio element and call play () :
document.getElementById ('yourAudioTag'). Play ();
load () ,
) , and some other properties of the audio element.
Alternatively
& lt; Script src = "soundmanager2.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; // To find Flash SWF, if necessary ... soundManager.url = '/ path / to / swf-files /'; SoundManager.onready (function () {soundManager.createSound ({id: 'mySound', url: '/path/to/an.mp3'}) ... and play this sound manager play ('mySound') ;});
No comments:
Post a Comment