【发布时间】:2016-02-11 11:19:36
【问题描述】:
我在我的 Wordpress 主题中使用 Twitters Bootstrap 中的一小段代码。有没有办法当用户关闭窗口时,即使刷新后它也保持关闭状态?我需要在会话的剩余时间或至少一个小时内保持关闭窗口。
刷新后窗口会重新出现。
<div class="alert alert-note alert-dismissible fade in" role=alert>
<button type=button class=close data-dismiss=alert aria-label=Close>
<span aria-hidden=true>×</span>
</button>
<h2>Upgrade to Pro for £2</h4>
<p>Upgrade to a voclr.it Pro Account for just £2 a month and unlock many great features.</p>
<div class="row">
<div class="col-sm-4">
<h4>Previews</h4>
<img src="<?php bloginfo('template_url') ?>/img/start4.png" alt="start4" width="64" height="64">
</div>
<div class="col-sm-4">
<h4>Premium Sample Packs</h4>
<img src="<?php bloginfo('template_url') ?>/img/pulse2.png" alt="pulse2" width="64" height="64">
</div>
<div class="col-sm-4">
<h4>No More Adverts</h4>
<img src="<?php bloginfo('template_url') ?>/img/forbidden.png" alt="forbidden" width="64" height="64">
</div>
</div>
</div>
【问题讨论】:
-
你试过localStorage吗?
标签: javascript wordpress twitter-bootstrap