【发布时间】:2018-08-06 21:52:51
【问题描述】:
我想知道是否有合理的简单方法可以在页面未向用户显示一段时间后显示模式。所以我有一个页面,我没有关闭它,但我转到另一个页面,一旦发生这种情况,如果我在不到 5 分钟内没有回到页面,则会显示一个模式告诉我“我离开了这么久,我应该刷新它”所以当我回到那个页面时,我看到了那个模式。
显然我只是“请求”时间码,已经得到了模态,这里是:
<div style="padding: 20px;"id="id01" class="w3-modal">
<div class="w3-modal-content w3-animate-top w3-card-4">
<header class="w3-container w3-teal">
<span onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-display-topright">×</span>
</header>
<div style="width: 100%" class="w3-container">
<p id="captcha_advertencia">¡Vaya!</p>
<img src="imagenes/captchaIncorrecto.jpeg" />
<p>Los valores que has introducido no se corresponden con el captcha</p>
<p>Por favor introduce correctamente los caracteres de la imagen</p>
</div>
</div>
</div>
感谢您的宝贵时间
【问题讨论】:
-
超时等可能会在选项卡未“活动”时暂停,因此我宁愿将当前时间戳与选项卡变为“非活动”时存储的时间戳进行比较,而不是使用这些时间戳检测到,当用户返回时。
-
检查这可能会有所帮助stackoverflow.com/questions/13246378/…
标签: javascript php html css