Skip to content

Instantly share code, notes, and snippets.

@lamp
Created September 13, 2011 10:34
Show Gist options
  • Select an option

  • Save lamp/1213563 to your computer and use it in GitHub Desktop.

Select an option

Save lamp/1213563 to your computer and use it in GitHub Desktop.
$(function(){
var intervals = [];
$("#scroller-inner").children('div').each(function(k, v){
intervals.push(parseInt($(this).attr('id').split('-')[1]));
})
setInterval(function(){
if(typeof(player.isSessionReady) == 'undefined') return;
if(!player.isSessionReady()) return;
var offset = Math.round(player.getOffset());
var filtered = [];
$.each(intervals, function(i, v){
if(v <= offset){
filtered.push(v)
}
});
$('.thumb-seek').removeClass('thumb-current');
$('#seek-' + filtered.reverse()[0]).addClass('thumb-current');
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment