You are viewing our Forum Archives. To view or take place in current topics click here.
[JS] Website Title Looping Script
Posted:
[JS] Website Title Looping ScriptPosted:
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 2,684
Reputation Power: 122
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 2,684
Reputation Power: 122
This is just a little script which keeps the page title looping on a website. What I mean by this is when, for example, you receive a chat message on Facebook and the title switches between "Facebook" and "XXX sent you a message" in a continuous loop.
I hope you find this somewhat useful anyway. Please also feel free to post any enhancements upon the script which you come up with
[ Register or Signin to view external links. ]
I hope you find this somewhat useful anyway. Please also feel free to post any enhancements upon the script which you come up with
[ Register or Signin to view external links. ]
function title_loop () {
cycle_count === title_count ? cycle_count = 0 : false;
document.title = titles[cycle_count];
cycle_count++;
setTimeout(function() {
title_loop();
}, 250); //<-- determines interval
}
//The titles to loop through
titles = [
'Facebook',
'Joe Bloggs sent you a message'
];
title_count = titles.length;
cycle_count = 0;
title_loop();
#2. Posted:
Status: Offline
Joined: Sep 05, 201014Year Member
Posts: 3,218
Reputation Power: 209
Status: Offline
Joined: Sep 05, 201014Year Member
Posts: 3,218
Reputation Power: 209
Nice script Jordan, I'll definitely find a use for this in the future.
Keep up the good work
Keep up the good work
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.