Javascript Blinking Page Title

I thought I might contribute to the world of bad scripts today. Here’s one I wrote that can be used to be pretty annoying.

——

originalTitle=document.title

// functions to blink the title of the page with a message
function blinkTitle(message, count) {
blinkingTitle(count, message, true);
}

function blinkingTitle(count, message, blink){
if(blink){
document.title=message;
} else {
document.title=originalTitle;
count– // decrement the number of times left to blink
}
if (count > 0) {
blinkTimer = setTimeout(”blinkingTitle(”+count+”, ‘”+message+”‘, “+!blink+”)”, 800);
}
}

—–

You can call this crazy title blinking with something like: blinkTitle(’bitches!’,2)

Try this one in your body tag:
onload=”setInterval(’blinkTitle(”drink.”, 3)’, 1000*60*5);”

That should make your page title blink ‘drink.’ three times every five minutes. Fun times.

5 Comments

  1. Posted May 3, 2007 at 4:20 pm | Permalink

    i love it.
    my visitors will love it too…if they know whats good for them.

  2. Jake

    Posted May 6, 2007 at 4:09 am | Permalink

    Ah, I fondly remember the days when marquees and blinking text was all the rage.

  3. MikeCa

    Posted May 10, 2007 at 7:12 am | Permalink

    Off topic: If its true, then congrats on the new tech venture w/ Digg guys.

    http://gigaom.com/2007/05/09/kevin-rose-new-company/

  4. Posted May 31, 2007 at 6:46 am | Permalink

    onload=”setInterval(’blinkTitle(”I’m not a programmer other than this thread tell me how I do .”, 3)’, 1000*60*1);”

  5. Posted May 31, 2007 at 6:47 am | Permalink

    not so well I guess