My suggestion is to add a class active
to your css:
.active {
background-color: rgb(0, 0, 250);
}
Then add active
class to the clicked button as well as removing this class from other button:
$('#vimeo_player_button').click(function(){
$('#youtube_player').animate({
marginLeft: '-1000px'
});
$('.active').removeClass('active');
$(this).addClass('active');
});
$('#youtube_player_button').click(function(){
$('#youtube_player').animate({
marginLeft: '0'
});
$('.active').removeClass('active');
$(this).addClass('active');
});