Forum Moderators: open

Message Too Old, No Replies

How can I flash the browser title in taskbar?

somebody help me!

         

phuongnam

4:27 am on Jul 27, 2004 (gmt 0)



Hi, I'm a newbie here and I need your help :-)

Some program can flash (blink) the title in the task bar (like Yahoo Messenger: flash it's title when new message arrive), so how can I use JavaScript to make the title of the browser flash? Is it possible?

Thanks for your help :)

RonPK

9:38 am on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello phuongnam,

I guess it can be done by addressing the documents title-property with some script using setInterval() to periodically call a function that toggles the title on and off.

Personally I hate blinking stuff, and I'm not alone at that.

kodaks

1:48 pm on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World, phuongnam!

I am not sure if this is what you are looking for, but here is a script that changes the title after every set time. I have set it up below, in order for it to seem like it is blinking:
------------------------------------------------------
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function settitle() {
var a = "Welcome to Acme Block Building";
var b = "";
var c = "Welcome to Acme Block Building";
var t = new Date();
s = t.getSeconds();
if (s == 2) {
document.title = a;}
else if (s == 20) {
document.title = b;}
else if (s == 30) {
document.title = c;}
else if (s == 40) {
document.title = a;}
else if (s == 50) {
document.title = b;}
else if (s == 00) {
document.title = c;}
setTimeout("settitle()", 1000);
}
// End -->
</script>

<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->

<BODY onLoad="settitle()">
------------------------------------------------------
I hope this helps, and good luck!

(I got this script off of javascript source)