让网页标签页头部有新消息提醒和Title标题文字滚动显示效果

2019-05-18网页设计
149

demo展示1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>让网页的Title标题文字滚动显示效果</title>
    </head>

    <body bgcolor="#ffffff" onload="newtext()">
        <script language=javascript>
            var text = document.title
            var timerID

            function newtext() {
                clearTimeout(timerID)
                document.title = text.substring(1, text.length) + text.substring(0, 1)
                text = document.title.substring(0, text.length)
                timerID = setTimeout("newtext()", 100)
            }
        </script>
    </body>

</html>


demo展示2:

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="UTF-8"/>
        <title>JS实现title标题闪烁提示信息</title>
    </head>
    <body>
        <script type="text/javascript">
            _record = 0;
            var myTitle = document.title;

            function titleBlink() {
                _record++;
                if(_record == 3) { //当变量_record累加到3是,将其赋值为1。相当于无限循环。
                    _record = 1;
                }
                if(_record == 1) {
                    document.title = '【  】' + myTitle;
                }
                if(_record == 2) {
                    document.title = '【新消息】' + myTitle;
                }
                setTimeout("titleBlink()", 500); //调节时间,单位毫秒。
            }
            titleBlink();
        </script>
        
    </body>

</html>

The End
滚动

相关推荐

让网页标签页头部有新消息提醒和Title标题文字滚动显示效果
demo展示1: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlns=http://www.w3.org/1999/xhtml head meta http-equiv=Content-Type content=text/html; charset=utf-8 / tit...
2019-05-18 网页设计
149

Marquee滚动字幕设置教程
滚动字幕 Marquee设置教程 marquee 滚动文字 /marquee 方向 direction=# #=left, right,up,down 方式 bihavior=# #=scroll, slide, alternate marquee behavior=scroll一圈一圈走!/marquee marquee behavior=slide只滚动一次就停...
2017-06-13 网页设计
43

本站js返回顶部特效
htmlheadtitle返回顶部特效,滚动条拖至最底部/titlescript language="javascript" src="jquery-1.6.2.min.js"/script //自己去下载,或者链接google链接script language="javascript"$(function(){ var $backToTopTxt = "返回顶...
2017-06-13 网页设计
19

实现textarea限制输入字数
实现textarea限制输入字数(包含中文只能输入10个,全ASCII码能够输入20个)textarea称文本域,又称文本区,即有滚动条的多行文本输入控件,在网页的提交表单中经常用到。与单行文本框text控件不同,它不能通过maxlength属性来限制...
2016-04-19 网页设计
61

textarea属性设置详解
1.overflow内容溢出时的设置(设定被设定对象是否显示滚动条)overflow-x水平方向内容溢出时的设置overflow-y垂直方向内容溢出时的设置以上三个属性设置的值为visible(默认值)、scroll、hidden、auto。2.scrollbar-3d-ligh...
2016-04-19 网页设计
410

修改好的jquery滚动字幕效果实现代码-jquery
跟版精品模板网提供jquery,滚动字幕,等网页设计素材资源,提供相关网页设计资源的教程和免费下载。跟版网,专业织梦网页设计模板资源站。。...
2016-04-14 网页设计
129