我试图在我的ASP.NET web应用程序中实现引导5祝酒词,使用以下代码.
<div class="row">
<div class="toast" id="companyUpdOK" name="companyUpdOK" role="alert" data-delay="5000" data-autohide="true" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="me-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
Hello, world! This is a toast message.
</div>
</div>
</div>JavaScript
$('#companyUpdOK').toast(); // code to set up toast
...
$('#companyUpdOK').show(); // and later, the code to display the toast因此,吐司出现了,但自动隐藏不工作,关闭按钮也不工作。我尝试了我能找到的所有组合,包括在初始化土司时设置选项,如下所示:
$('#companyUpdOK').toast({delay: 5000, autohide: true});这些都不管用。我做错了什么?
https://stackoverflow.com/questions/72547503
复制相似问题