views:

31

answers:

2

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?

+2  A: 

You can use the following javascript to trigger this.

window.focus();
Mitchel Sellers
i have tried it alreayd, its not working
stunaz
A: 

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.

idealmachine
how is it possible?
stunaz
@stunaz: I've added example code.
idealmachine
@idealmachine, thanks
stunaz