Adding Sound to JQuery Cycle Plugin

I am using jQuery Plugin and would like to add sound to my slide show. I use the shuffle effect and whenever I need to go to the next slide, I would like the sound to play.

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

jquery.malsup.com/cycle/- This is a plugin site.

These are the js files that I use.

Thank you so much!

+3
source share
1 answer

Have a look at this previous question:

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

And use what you learn from this to play the sound from the loop before and after the callbacks , for example:

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

Source: https://habr.com/ru/post/1779258/


All Articles