Skip to content

Instantly share code, notes, and snippets.

@manikrathee
Created October 15, 2012 02:21
Show Gist options
  • Save manikrathee/3890508 to your computer and use it in GitHub Desktop.
Save manikrathee/3890508 to your computer and use it in GitHub Desktop.
Boombox - Actions
// Background Change based on track click
$('#main-stream').on('click', '.stream-item', function(){
streamItem = $('this');
albumArt = $('this').data('album-art-background');
console.log( streamItem.data('album-art-background') );
console.log('stream-clicked');
if ($('body').hasClass('active')){
$('body').addClass('tracked').css('background-image','url("' + albumArt + '")');
}
});
// Set ACTIONS to active/inactive on Click
$('#main-stream').on('click', '.track-action-item', function(e){
e.preventDefault();
e.stopPropagation();
console.log('action-clicked');
$('.track-action-item').toggleClass('active');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment