//向左滚
if(i==0){
var title=document.title;
var firstch = title.charAt(0);
var leftstr = title.substring(1,title.length);
document.title = leftstr + firstch;
}
//向右滚
if(i==1){
var title=document.title;
var lastch = title.charAt(title.length-1);
var leftstr = title.substring(0,title.length-1);
document.title = lastch + leftstr;
为什么两个都是length-1? |