Marek123 Marek123 - 19 days ago 10
Javascript Question

Bootstrap - direct link to modal window

Is it possible to have an url like this:

www.url.com/#imprint


(or similar) to link directly to the page with the opened modal window?

is this possible? Any hints?

Thank you!

Answer

You might be able to do something like this.

if (window.location.hash == "#imprint") {
     $('#myModal').modal('show');
}