我的网站有一个模式付款表格。我想要的只是(对于某些特定客户)向他们传递一个链接,当他们单击该链接时移动到模式已经打开的网站。 这可能吗?
最佳答案
您必须自己促进该功能。假设您有像这样的正常引导模式:
<div class="modal fade" id="payment">
<div class="modal-dialog">
<div class="modal-content">
...
</div>
</div>
</div>
并且您希望在发送给某些用户的链接中调用页面加载模式:
然后将此代码片段添加到您的页面:
$(document).ready(function() {
var modals = ['#payment', '#anotherModal'];
if (window.location.hash && ~modals.indexOf(window.location.hash)) {
$(window.location.hash).modal();
}
})
这当然是迄今为止最简单的方法。
关于hyperlink - 如何从外部链接链接到模式对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35024689/