提醒弹出窗口具有Snooze功能,不应在主线程上运行。 [英] Reminder Popup have Snooze functionality and which should not run on main thread.

查看:97
本文介绍了提醒弹出窗口具有Snooze功能,不应在主线程上运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们我正在开发CRM产品,并且我需要使用提醒弹​​出窗口。弹出窗口最初会出现在Dashboard Loads但问题是如何为弹出窗口提供贪睡功能

Hi,Guys I am working on CRM product and in that i need to use reminder popup.The Popup will come initially when Dashboard Loads but the problem is how i can provide snooze functionality for popup
.

推荐答案

如果客户支持html5你可能会使用工人



http://www.html5rocks.com/en/tutorials/workers/basics/ [ ^ ]



如果您想支持所有浏览器,那么window.setTimeout可能是您的最佳选择。当用户点击贪睡时,您可以启动setTimeout 5分钟(或多长时间),当超时触发时,您可以重新显示弹出窗口。



您不会说用户此时是否正在更改页面,以及计时器是否从最初打盹时开始。如果是这种情况,您需要在cookie中写出暂停到期的时间,并在页面上看到cookie存在的脚本并设置适当的超时间隔。
If the client supports html5 you could probably use workers

http://www.html5rocks.com/en/tutorials/workers/basics/[^]

If you want to support all browsers then window.setTimeout is probably your best option. When the user clicks "snooze" you can start a setTimeout for 5 minutes (or however long) and when the timeout fires you can re-display your pop-up.

You don't say if the user is changing pages at this time though and if the timer is to fire from when it was originally snoozed. If that's the case you'll need to write the time the snooze expires in a cookie and have script on the page that sees the cookie is there and sets the appropriate timeout interval.


这篇关于提醒弹出窗口具有Snooze功能,不应在主线程上运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆