function changeTitle() {
var title = $(document).prop('title');
if (title.indexOf('>>>') == -1) {
setTimeout(changeTitle, 3000);
$(document).prop('title', '>'+title);
}
}
changeTitle();
Some code to walk through a list of titles (circularily or one-shot):
var titles = [
" title",
"> title",
">> title",
">>> title"
];
// option 1:
function titleAniCircular(i) {
// from first to last title and back again, forever
i = (!i) ? 0 : (i*1+1) % titles.length;
$('title').html(titles[i]);
setTimeout(titleAniCircular, 1000, [i]);
};
// option 2:
function titleAniSequence(i) {
// from first to last title and stop
i = (!i) ? 0 : (i*1+1);
$('title').html(titles[i]);
if (i<titles.length-1) setTimeout(titleAniSequence, 1000, [i]);
};
// then call them when you like.
// e.g. to call one on document load, uncomment one of the rows below:
//$(document).load( titleAniCircular() );
//$(document).load( titleAniSequence() );