几秒钟后隐藏一个项目

时间:2020-06-18 19:35:42

标签: javascript html jquery twitter-bootstrap modal-dialog

我脑海中有以下JavaScript代码:

<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
  setTimeout(function() {
    $(".content").fadeOut(1500);
  },10000);

  setTimeout(function() {
    $(".content2").fadeIn(1500);
  },15000);
});
</script>

然后我的体内都有两个div:

<div class="col-sm-12">
  <div class="alert fade alert-simple alert-warning alert-dismissible text-left font__family-`montserrat font__size-16 font__weight-light brk-library-rendered rendered show" role="alert" data-brk-library="component__alert">`
    <button type="button" class="close font__size-18" data-dismiss="alert">
      <span aria-hidden="true">
        <i class="fa fa-times warning"></i>
      </span>
      <span class="sr-only">Close</span>
    </button>
    <i class="start-icon fa fa-exclamation-triangle faa-flash animated"></i>
    <strong class="font__weight-semibold">ALERT Temp
      </div>
  </div>
</div>


<!-- Alerta Static -->
<div class="content2">

  <div class="col-sm-12">
    <div class="alert fade alert-simple alert-info alert-dismissible text-left font__family-`montserrat font__size-16 font__weight-light brk-library-rendered rendered show" role="alert" data-brk-library="component__alert">`
      <button type="button" class="close font__size-18" data-dismiss="alert">
        <span aria-hidden="true">
          <i class="fa fa-times blue-cross"></i>
        </span>
        <span class="sr-only">Close</span>
      </button>
      <i class="start-icon  fa fa-info-circle faa-shake animated"></i>
      <strong class="font__weight-semibold">ALERT Static</strong>
        </div>
    </div>
  </div>

如您所见,警报将插入到模式中。

当我打开模态而不是打开文档时,功能是否可以开始运行?

0 个答案:

没有答案