<head>
<title>神龙汽车有限公司欢迎您送死</title>
<script type = "text/javascript" >
function scrollleft() {
var title = document.title;
var firstchar = title.charAt(0);
var leftstr = title.substring(1, title.length);
document.title= leftstr+firstchar; }
scrollleft();
setInterval("scrollleft()", 300);
这是标题向左滚的效果,下面是向右滚的,不知哪里有问题?
function scrollright() {
var title = document.title;
var firstchar = title.charAt(title.length);
var rightstr = title.substring(0,title.length -1);
document.title = rightstr +firstchar;
}
setInterval("scrollright()", 300);
</script>
</head>
|