开发者

How to trigger sound whenever a user clicks an element

How can I play开发者_高级运维 an mp3 or wav sound using the jquery click event?

i want to add click sound not any track or song


You might find the jQuery Sound Plugin of use:

This is a simple sound player, it uses flash to play the sounds, but DOES NOT provide a flash interface for any controls, everything is controlled via jQuery

$("#sound").sound({swf: url});
$("#sound").load(url);
$("#sound").play();
$("#sound").pause();
$("#sound").stop();
$("#sound").volume(0-100);


You can't use DHTML to play sound. You can use a flash player like this one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜