title: Close bootstrap modal without using "hide" and "data-dismiss"
body: <p>I want to close bootstrap modal box conditionally. If I use 
  <code>$('#modal').modal('hide');</code> this, some thing goes wrong with my code. And If I use <code>data-dismiss="modal"</code> in the HTML template, modal dismiss action performs before my actual functionality should be perform on button click.</p>
  
  <p>So, there is any other way to close bootstrap modal or any idea to use <code>data-dismiss="modal"</code> at run time?</p>