小编Joh*_*lln的帖子

Bootstrap 4隐藏未关闭的警报

正如标题所述,我想知道隐藏警报的最佳方法,以便我们可以在不重新加载页面的情况下获得另一个警报。这里有几个针对 BS3 的答案,但我希望 BS4 有更好的解决方案。
这是我的 HTML:

<div style="display: none;" class="alert alert-danger alert-with-icon" data-notify="container">
          <div class="container">
              <div class="alert-wrapper">
                  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                      <i class="nc-icon nc-simple-remove"></i>
                  </button>
                  <div class="message"><i class="nc-icon nc-bell-55"></i>
                      My alert message.
                  </div>
              </div>
          </div>
      </div>
Run Code Online (Sandbox Code Playgroud)

我用它来触发打开警报:

$('.alert').show();
Run Code Online (Sandbox Code Playgroud)

javascript alert twitter-bootstrap bootstrap-4

1
推荐指数
1
解决办法
3940
查看次数