Twitter bootstrap modal disappear and disappear after half a second on manual toggle

My modal mode works fine until I switched to manual show mode. I call modal with the following simplified javascript code:

var dlg = $('#loginDlg');
dlg.modal({show:false});
if(loggedIn) {
  logout();
} else {
  dlg.modal('show');
}

      

I am using bootstrap as meteor planet, so only included bootstrap.js

.

My markup:

<button type="button" class="btn btn-large span1" id="login" role="button"
        data-toggle="modal" data-target="#loginDlg">
  <i class="icon-off pull-right"></i>
</button>
<div class="modal hide fade" id="loginDlg" tabindex="-1"
     role="dialog" aria-labelledby="loginDlgLabel" aria-hidden="true">
  ---
</div>

      

Maybe I need to change the markup?

EDIT:

Solution: I need to remove an attribute data-target

in my button markup! Bootstrap switches modal format twice with this attribute.

+3


source to share


1 answer


Solution : I had to remove the attribute data-target

in my button markup! Bootstrap switches modal format twice with this attribute.



+2


source







All Articles