Answer the question
In order to leave comments, you need to log in
Is it possible to open a bootstrap modal window depending on the anchor in the URL?
Faced with the need to open a modal window if the user clicked on the url .com/page#myNameModal
Is this possible using standard bootstrap tools? Maybe there is an attribute that is responsible for this? Or you need to write some js.
P.S. Give a link to an explanation of additional type attributes
data-dismiss="modal"
aria-labelledby="myModalLabel"
aria-hidden="true"
Answer the question
In order to leave comments, you need to log in
Like this:
$(document).ready(function () {
var hash = window.location.hash;
if (hash === "#myNameModal") {
$('#myModal').modal(options);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question