Skip to content

Instantly share code, notes, and snippets.

View baptistebriel's full-sized avatar

Baptiste Briel baptistebriel

View GitHub Profile
@mataspetrikas
mataspetrikas / gist:1509934
Created December 22, 2011 11:10
control next and previous tracks in the soundcloud custom player
function getNextTrack(node) {
var $player = $(node).closest('.sc-player'),
$nextItem = $('.sc-trackslist li.active', $player).next('li');
// try to find the next track in other player
if(!$nextItem.length){
$nextItem = $player.nextAll('div.sc-player:first').find('.sc-trackslist li:first');
}
return $nextItem;
};