javascript - 在HTML中加载页面3秒后加载引导警报

标签 javascript jquery html css twitter-bootstrap-3

我想在HTML页面加载3秒后加载引导警报
below

 <div class="col-md-12 visible-xs " >
<div class="alert  alert-dismissible " style="position:fixed;color:white;padding:5px 0px;background:#413A3A;bottom:5%;width:90%;z-index:99999;align:center;" role="alert">
<div class="col-xs-10 "> 
 <p style="font-size:10.5px;align="right"">In order to give you best browsing experience, this website uses cookies. If you continue we assume that you accept our <a style="color:white;font-weight:600;" href="cookies_policy.php">cookies policy.</a>
</p>
</div>
<div class="col-xs-2 " style="padding-left:0px;">
 <button style="margin-left:0px;bottom: 50%;" type="button" class="btn btn-success " data-dismiss="alert" aria-label="Close">Agree</button>
</div>
</div>
</div>

最佳答案

您可以隐藏潜水并在3秒后通过jQuery显示它,如下所示:

$(document).ready(function () {
  $("#popupCookie").show(3000) ;
});


和您的html:

<div class="col-md-12 visible-xs" hidden id="popupCookie">
  <div class="alert  alert-dismissible "
    style="position:fixed;color:white;padding:5px 0px;background:#413A3A;bottom:5%;width:90%;z-index:99999;align:center;"
    role="alert">
    <div class="col-xs-10 ">
      <p style="font-size:10.5px;align=" right"">In order to give you best browsing experience, this website uses
        cookies. If you continue we assume that you accept our <a style="color:white;font-weight:600;"
          href="cookies_policy.php">cookies policy.</a>
      </p>
    </div>
    <div class="col-xs-2 " style="padding-left:0px;">
      <button style="margin-left:0px;bottom: 50%;" type="button" class="btn btn-success " data-dismiss="alert"
        aria-label="Close">Agree</button>
    </div>
  </div>
</div>

关于javascript - 在HTML中加载页面3秒后加载引导警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59865995/

相关文章:

javascript - 函数显示和隐藏表单元素

javascript - Highcharts 被压缩在 html 选项卡中

php - WooCommerce 中的动态同步自定义结帐选择字段

javascript - JS - 射击 - 鼠标

html - Z-index 不适用于带有 p 的 img 和 div

javascript - 添加新消息时如何自动向下滚动

javascript - Input type FILE multiple - 按顺序添加文件

jquery - Bootstrap Popover 悬停 - 内容中间无法正常工作

html - 段落控制?

html - 尝试让 CSS 切换器与 ASP.NET 呈现的复选框一起使用