jQuery的声音 [英] jQuery Sound

查看:289
本文介绍了jQuery的声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是的jQuery插件的声音的创建我的网站上一些声音效果但我不能得到它玩。我收到此消息:

I am using the jQuery Sound Plugin to create some sound effects on my site yet I cannot get it to play. I recieve this message:

settings.events.error(null, {msg: "You have not yet bound the sound player to 
this element"});    

我是什么做错了吗?这里是我的code:

What am I doing wrong? Here is my code:

<script type="text/javascript">
 var $j = jQuery.noConflict();
 $j(".sound1").sound({swf: url});
 $j(".sound1").load(url);
 $j(".sound1").play();
 $j(".sound1").pause();
 $j(".sound1").stop();
 $j(".sound1").volume(0-100);
 $j('.sound1').mouseover(function() {
 $j(".sound1").play('/messages4u/2011/images/october/sound1.mp3');
});
</script>

我不知道是否需要在code一切其实我并不擅长JS,需要一些帮助!我需要指定的网址?如果是的话是什么?

I am not sure if everything is needed in the code yet I am not that good at JS and need some help! Do I need to specify the URLs? If so to what?

推荐答案

我不知道JS-与-FLASH API的所有但作为一个非常基本的观察,如果页面有一个SWF组件来加载,它看起来像它加载之前这个JS是射击。您需要委托的情况下,或使用一个回调,如果有一个可用的。

I don't know JS-with-FLASH APIs at all but as a very basic observation, if the page has an SWF component to load, it looks like this JS is firing before it has loaded. You will need to delegate the event or use a callback if there's one available.

甚至更基本:的有包括页面上的Flash组件?该项目似乎放弃了(没有官方网页,当我去寻找API);他们是否包括它与你使用的下载?

Or even more basic: is there the flash component included on the page? That project seems abandoned (no official homepage when I went looking for the API); did they include it with the download you used?

由于错误消息说,这个元素的,是有可能的Flash组件未侦听与类Sound1例子的元素?有没有实际上的页面?

Since the error message says "on this element", is it possible that the Flash component isn't listening for an element with the class "sound1"? Is there in fact an element with that class on the page?

我不得不承认,我可能不应该试图用这么多的未知数回答。这个插件是相当老无人维护,所以没有我能找到演示页,我厌恶安装整个事情。你有一个活链接?

I have to admit, I probably shouldn't have tried answering with so many unknowns. The plugin is rather old and unmaintained, so there's no demo page that I could find, and I'm loathe to install the whole thing. Do you have a live link?

这篇关于jQuery的声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆