如何让浏览器的title动起来

186 阅读1分钟
let text = document.title
var tiemrId;
function newtext(){
  clearTimeout(tiemrId)
  document.title = text.substring(1,text.length) + text.substring(0,1)
  text = document.title.substring(0,text.length)
  timerId = setTimeout("newtext()", 500)
}
newtext()