gpt4 book ai didi

jquery - Bootstrap 模态,完成某事后显示

转载 作者:太空宇宙 更新时间:2023-11-04 11:38:07 25 4
gpt4 key购买 nike

我使用 bootstrap 成功创建了一个模态框。但到目前为止,我只能在单击按钮时显示此模式:

<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>

我怎样才能在完成某件事后显示这个模态?或者换句话说:如何在代码中触发此模态?

最佳答案

只需触发该按钮的点击处理程序:

$('[data-target="#myModal"]').trigger('click');

关于jquery - Bootstrap 模态,完成某事后显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31582816/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com