$(document).on('click', '.selector', function(event) {
var id= $(this).data('id');
toggleBounce(markers[id]);
});
function toggleBounce(marker) {
if (marker.getAnimation() !== null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
}