【问题标题】:Creating a DIV Popup Warning创建 DIV 弹出警告
【发布时间】:2014-08-05 17:54:38
【问题描述】:

在这个例子中:HTML / CSS Popup div on text click

当他们第一次访问该站点时,如何在索引页面上进行此加载。我不想点击按钮,我希望自动加载;然后在他们阅读弹出窗口上的内容时有一个关闭按钮。提前致谢。

【问题讨论】:

  • 尝试什么?你的代码在哪里?

标签: html css popup onload


【解决方案1】:

您好,您可以使用引导模型弹出窗口来执行此操作 为此包括引导 css 和 js 文件并使用以下代码

您的 HTML 代码

<div class="modal fade" id="myModal" tabindex="-1" role="dialog"  arialabelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Intorduction</h4>
      </div>
      <div class="modal-body">
        Body Text
      </div>
      <div class="modal-footer">
        <a  class="btn btn-default"  data-dismiss="modal">Close</a>

      </div>
    </div>
  </div>
</div>

然后使用这个脚本

<script>
      if (localStorage.getItem('showModal')!='yes')
        {
        localStorage.setItem('showModal','yes');
        $('#myModal').modal('show');

        }

 </script>

【讨论】:

  • 请不要回答不清楚或不好的问题,它会鼓励更多不好的问题。
  • 我能理解这就是我回复的原因
猜你喜欢
  • 2015-08-07
  • 2018-06-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多