title: How to hide Bootstrap previous modal when you opening new one?
body: <p>I have such trouble: I have authentification which is made using Bootstrap modals.</p>
  
  <p>When user opens sign in modal he can go to sign up modal ( or other ) . So, I need to close previous one. </p>
  
  <p>Now I'm closing them like this:</p>
  
  <pre><code>$(document).ready(function(){
    $("a").click(function() {
    $("#login").hide();
    $("#sign_up").hide();
   })  
  });
  </code></pre>
  
  <p>but when I'm doing this - I can't reopen sign in modal( after click on sign up from sign in) until I refresh the page.</p>
  
  <p><b>Can someone suggest how to check on what modal I'm clicking on the link and close it, when call another one ? Is there any universal way to close previous modal ? </b></p>