var text=document.title;//获得页面的标题
var timerID;//定时器
function newtext() {
clearTimeout(timerID);
document.title=text.substring(1,text.length)+text.substring(0,1);//截取字符重新赋值给title
text=document.title.substring(0,text.length);
timerID = setTimeout("newtext()", 500);
}
window.onload=function(){
newtext();
};
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)