【发布时间】:2014-08-05 17:54:38
【问题描述】:
在这个例子中:HTML / CSS Popup div on text click
当他们第一次访问该站点时,如何在索引页面上进行此加载。我不想点击按钮,我希望自动加载;然后在他们阅读弹出窗口上的内容时有一个关闭按钮。提前致谢。
【问题讨论】:
-
尝试什么?你的代码在哪里?
在这个例子中:HTML / CSS Popup div on text click
当他们第一次访问该站点时,如何在索引页面上进行此加载。我不想点击按钮,我希望自动加载;然后在他们阅读弹出窗口上的内容时有一个关闭按钮。提前致谢。
【问题讨论】:
您好,您可以使用引导模型弹出窗口来执行此操作 为此包括引导 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">×</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>
【讨论】: