Take this link in a new tab or window, and take any other website without closing it. After 3 seconds , (Consider it as a new chat message arrived situation) you can see the google chat notification sound , and title changing. (I...
See more »
Take this link in a new tab or window, and take any other website without closing it. After 3 seconds , (Consider it as a new chat message arrived situation) you can see the google chat notification sound , and title changing. (I didn’t get the actual gtalk notification sound, so i used windows notify.wav file ) You know google (gmail) implemented its sound notification is via swf object. Here me too done the same. I wrote two function to check whether the browser is in focus or not. Here is the functions: function lostFocus() { document.title = 'Sajith M.R Says...'; state = 'nonfocus'; played = 0 ; changeColorRed(); alterTitle(); } function gotFocus() { document.title = 'Gmail Inbox(1)'; state = 'focus'; played = 0 ; } The alterTitle() function calls in 3 seconds setTimeOut manner. function alterTitle() { if(state =='nonfocus') { if ( document.title == 'Gmail Inbox(1)') { if(played == 0) { soundManager.play('notify'); played = 1; } document.title = 'Sajith M.R Says...'; } else document.title = 'Gmail Inbox(1)'; setTimeout("alterTitle()",3000); } } The soundmanager.js file handles the swf flash object and sound triggering. If you want the whole source code , mail me: admin@sajithmr.com
See less »
Kaboodle will send you a newsletter and updates from your friends. You can unsubscribe at any time. Kaboodle does not sell or share your email address or personal information with anyone.
Kaboodle requires all users to provide their real date of birth as both a safety precaution and as a means
of preserving the integrity of the site. You will be able to hide this information from your profile if you wish.
Added by 2 people