Reputation: 407
My website has a payment form in a modal. All I want is (for some specific customers) to pass them a link and when they click on it to move to the website with the modal already be open. Is that possible?
Upvotes: 2
Views: 5967
Reputation: 85518
You must facilitate the feature yourself. Lets say you have normal bootstrap modal like this :
<div class="modal fade" id="payment">
<div class="modal-dialog">
<div class="modal-content">
...
</div>
</div>
</div>
and you want to invoke the modal on page load in a link sent to some users :
Then add this code snippet to your page :
$(document).ready(function() {
var modals = ['#payment', '#anotherModal'];
if (window.location.hash && ~modals.indexOf(window.location.hash)) {
$(window.location.hash).modal();
}
})
This is of course by far the most simple way to do it.
Upvotes: 4