Js跑马灯效果

来源:互联网 发布:时间函数php 编辑:程序博客网 时间:2024/05/01 23:03
 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>xy欢迎新同学——跑马灯效果</title>
    <script type="text/javascript">
        function scroll() {
            var title = document.title;
            var firstChar = title.charAt(0);               // 取得第一个字符
            var leftChar = title.substr(1, title.length);
            document.title = leftChar + firstChar;
        }

        启动的时候执行
        setInterval("scroll()", 500);
    </script>
</head>
<body>

</body>
</html>