开发者

Adding sound to JQuery Cycle Plugin

I am using the JQuery Plugin and would like to add sound for when my slideshow is going. I am using the shuffle effect and whenever it is to go to the next slide I would like a sound to be played.

$('#chars').cycle({
    fx:     'shuffle',
    prev:   '#prev',
    next:   '#next',
    timeout: 6000,
    speed:  800
});

jquery.malsup.com/cycle/ - Tha开发者_开发问答t is the Plugin site.

These are the js files I am using.

Thanks a lot!


Have a look at this previous question:

Cross-platform, cross-browser way to play sound from Javascript?

And use what you learn from that to play a sound from within Cycle's before and after callbacks, e.g.:

$('#chars').cycle({
    fx:     'shuffle',
    prev:   '#prev',
    next:   '#next',
    timeout: 6000,
    speed:  800,
    after: function() { soundPlay("vrooOOoom"); }
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜