如果我去这里
getbootstrap/2.3.2/javascript.html#modals
然后点击启动演示模式它会完成预期的操作。我正在使用模式作为我的注册过程的一部分,并且涉及服务器端验证。如果有问题,我想将用户重定向到同一模式,并显示我的验证消息。目前我无法弄清楚除了来自用户的物理点击之外如何显示模态。如何以编程方式启动模型?
And click 'Launch demo modal' it does the expected thing. I'm using the modal as part of my signup process and there is server side validation involved. If there are problems I want to redirect the user to the same modal with my validation messages displayed. At the moment I can't figure out how to get the modal to display other than a physical click from the user. How can I launch the model programmatically?
推荐答案为了手动显示模态弹出窗口,您必须执行此操作
In order to manually show the modal pop up you have to do this
$('#myModal').modal('show');您之前需要使用 show:false 所以直到你手动完成它才会显示。
You previously need to initialize it with show: false so it won't show until you manually do it.
$('#myModal').modal({ show: false})其中 myModal 是模态容器的名称。
Where myModal is the name of the modal container.
更多推荐
如何以编程方式触发Bootstrap模式?
发布评论