开发者

Adding sound to JQuery Cycle Plugin

开发者 https://www.devze.com 2023-01-29 19:04 出处:网络
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.

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

精彩评论

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