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>
|
1 本网站名称:米米素材网
2 本站永久网址:https://www.mimisucai.cn
3 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权进行删除处理。
4 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
发表评论