标题滚动!!!!

var tit =function(){

var title = document.title;

var arr = title.split("");

var first = arr.shift();

arr.push(first); title =arr.join("");

document.title = title;

setTimeout(tit,1000);

};

其中 split 方法 用来将字符串转换为数组;

  join 方法 用来将数组转换成字符串;

  shift 删除并返回第一个数组元素;

  push 在最后面添加一个数组元素;

加油!!!!

posted @ 2017-05-27 20:27  李成杰  阅读(84)  评论(0编辑  收藏  举报