
大佬们,html 代码怎么让浏览器做窗口抖动,类似于微信收到消息那种任务栏抖动提示
1 chongdianbao 2023-07-18 11:33:31 +08:00 建议做个浏览器 |
2 pzistart OP @chongdianbao 你是真秀 陈泽秀都没你秀 |
3 coolfan 2023-07-18 11:50:17 +08:00 让浏览器发通知,像别的桌面程序一样可以从右下角弹窗消息,同时任务栏也会高亮吧 |
4 w292614191 2023-07-18 11:56:23 +08:00 document.title='您有的新的消息,[xxx 未完成,请及时审核!]',文字长一些,然后就会滚动效果了,看起来不错。 还有一种是: document.title='' sleep(1s) document.title='消息' 做个定时器会有闪动效果,用户感知会更强。 |
5 7gugu 2023-07-18 12:04:07 +08:00 原生浏览器做不了的,Web Notifications 才是正解,用这个可以帮你提醒用户 |
6 netnr 2023-07-18 12:54:40 +08:00 |
7 6IbA2bj5ip3tK49j 2023-07-18 21:12:56 +08:00 窗口抖不了,但是整个 body 抖一抖还是没问题的。 setInterval(function(){ var offsetX = Math.random() * 10 - 5; var offsetY = Math.random() * 10 - 5; document.querySelector('body').style.transform = 'translate(' + offsetX + 'px, ' + offsetY + 'px)'; setTimeout(function() { document.querySelector('body').style.transform = 'translate(0, 0)'; }, 50); },500) |