Home  >  Article  >  Web Front-end  >  js implements web page title scrolling

js implements web page title scrolling

一个新手
一个新手Original
2017-09-13 10:36:131913browse

 <script>
        //定时器
        setInterval(function(){
            //获得页面标题,是string类型
            var oldTitle=document.title;
            //转换为数组类型
            var titleArr=oldTitle.split(&#39;&#39;);
            //使标题的字符产生位置的变化
            titleArr.push(titleArr.shift());
            //连接为字符串
            document.title=titleArr.join(&#39;&#39;);
        },100);
 </script>
//上述代码中利用数组 字符串中的方法进行实现。
//熟悉的一切组合起来就是未知的  还是要努力学习啊

The above is the detailed content of js implements web page title scrolling. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn