You can actually detect when the old modal closes by calling the hidden.bs.modal
event:
$('.yourButton').click(function(e){
e.preventDefault();
$('#yourFirstModal')
.modal('hide')
.on('hidden.bs.modal', function (e) {
$('#yourSecondModal').modal('show');
$(this).off('hidden.bs.modal'); // Remove the 'on' event binding
});
});
For more info: http://getbootstrap.com/javascript/#modals-events