jquery swap sounds on rollover...
jquery swap sounds on rollover...
Out of context: Reply #1
- Started
- Last post
- 1 Response
- chrisRG0
I'd create do something like this:
keep track of the current file playing
var currentSong = 0;create an array with all song files:
var songFiles = [file1, file2, file3, file4];then on every rollover you go to the next array index:
function playNextSong(){
currentSong++;
if(currentSong >= songFiles.length) currentSong = 0;check here to learn how to swap the song:
http://stackoverflow.com/questio…
}