![](/img/trans.png)
[英]how to dynamically execute hubspot embed form script inside bootstrap modal popup via latest jquery in wordpress?
[英]How to bootstrap modal popup via a variable?
我正在研究引導程序,並按照示例進行操作:
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Shows the modal
</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title" id="myModalLabel">
模態框(Modal)標題
</h4>
</div>
<div class="modal-body">
在這里添加一些文本
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">關閉
</button>
<button type="button" class="btn btn-primary">
提交更改
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
如果單擊按鈕,將彈出模式對話框,但我不知道哪個變量控制着模式彈出窗口並消失。
我想通過一個變量來彈出它。 有一個要求。
當我進入一個Smarty頁面時,如果該頁面不存在access_token變量,我希望自動彈出模式對話框。
那么,在這個例子中如何實現?
觸發show方法。
var myModal = $("#myModal"); myModal.modal("show");
顯示模態:$('#myModal')。modal('show');
隱藏模態:$('#myModal')。modal('hide');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.