tristantzara
tristantzara

Reputation: 5897

Hide bootstrap modal without page reload

When I'm using bootstrap 3 modal when I dismiss it the page reloads and /?is added to location string. How can I just dismiss and hide modal without page reload?

Upvotes: 1

Views: 1010

Answers (1)

kro91
kro91

Reputation: 51

Your button that closes the modal will need to have the data-dismiss attribute and it should be equal to "modal"

    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

This code is straight from the Bootstrap website (http://getbootstrap.com/javascript/#modals)

Upvotes: 1

Related Questions