This line prevented the other modal from being shown before the first one disappeared. Without it, another backdrop (i.e. the dark shadowy layer) would appear over the first modal being it fully fades out and closes.

Was this the line that was responsible for the "infinite series of Modals" behaviour? The `$signupModal.on('hidden', $.noop)` call below prevents this handler from executing more than once per click of the "Log in now" link.

If the similar thing is done above for the login modal (i.e. `$signupModal.on('hidden', function() { ... }`), then this should work without the problem of infinite series of modals behaviour or having a backdrop overlap the modal.