Home > Web Front-end > JS Tutorial > body text

js implements web page title scrolling

一个新手
Release: 2017-09-13 10:36:13
Original
1987 people have browsed it

 <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>
Copy after login
//上述代码中利用数组 字符串中的方法进行实现。
Copy after login
//熟悉的一切组合起来就是未知的  还是要努力学习啊
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template