如何打开弹出窗口并使其从工具栏闪烁?

发布于 2024-09-27 16:19:34 字数 134 浏览 0 评论 0原文

只是作为聊天(yahoomessenger,msn .....)当我们收到新消息时,相应的窗口会闪烁

或在 Internet Explorer 中作为当我们完成下载某些内容时,相应的窗口会在工具栏中闪烁

如何使用弹出窗口?

Just AS a chat (yahoomessenger, msn .....) WHEN we get a new message, the corresponding window is flashing

or AS in internet explorer WHEN we finsh downloading something the corresponding window is flashing in the toolbar

How to do it with a popup?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雄赳赳气昂昂 2024-10-04 16:19:34

您可以使用以下 JavaScript 来触发此操作。

window.focus();

You can use the following javascript to trigger this.

window.focus();
野心澎湃 2024-10-04 16:19:34

这是无法通过网页中的 JavaScript 访问的。但是,您可以将标题栏更改为诸如“!!!!!!!!!!!!!!!!!!”之类的字符串。然后再次返回以获得类似的效果。

示例代码(位于 http://jsbin.com/ifewu3/2):

var oldTitle = '', titleBlanked = false, flashInterval;
flashInterval = setInterval(function () {
    if(!titleBlanked) {
        oldTitle = document.title;
        document.title = '!!!!!!!!!!!!!!!!';
        titleBlanked = true;
    } else {
        document.title = oldTitle;
        titleBlanked = false;
    }
}, 500);

然后调用 clearInterval(flashInterval) 当你想停止闪烁时。

That's not accessible from JavaScript in a web page. You could, however, change the title bar to a string such as "!!!!!!!!!!!!!!!!" and back again for a similar effect.

Example code (live at http://jsbin.com/ifewu3/2):

var oldTitle = '', titleBlanked = false, flashInterval;
flashInterval = setInterval(function () {
    if(!titleBlanked) {
        oldTitle = document.title;
        document.title = '!!!!!!!!!!!!!!!!';
        titleBlanked = true;
    } else {
        document.title = oldTitle;
        titleBlanked = false;
    }
}, 500);

Then call clearInterval(flashInterval) when you want to stop the flashing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文