多行数据滚动显示_html5
2021-03-22 05:26
阅读:635
YPE html>
标签:tee htm 标题 flow doc bsp code title ack
html5 滚动标题
转载:https://www.cnblogs.com/yanyanstyle/p/11287342.html
html>
head>
meta charset="utf-8">
title>html5title>
style>body {
margin: 0px;
font-size: 12px;
color: #938C43;
line-height: 150%;
text-align:center;
}
a:link{color: #9D943A;font-size:12px;}
a:hover{color: #FF3300;font-size:12px;}
a:visited{color: #9D943A;font-size:12px;}
a.red:link{color: #ff0000;font-size:12px;}
a.red:hover{color: #ff0000;font-size:12px;}
a.red:visited{color: #ff0000;font-size:12px;}
#marqueeBox{background:#f7f7f7;border:1px solid silver;padding:1px;text-align:center;margin:0 auto;}
-->
style>
head>
body>
h4>滚动新闻h4>
script language="JavaScript" type="text/javascript">var marqueeContent=new Array();
marqueeContent[0]="用快速取回帐号密码";
marqueeContent[1]="网易将军令官方网站";
marqueeContent[2]="最新壁纸下载";
marqueeContent[3]="最新屏保下载";
var marqueeInterval=new Array();
var marqueeId=0;
var marqueeDelay=2000;
var marqueeHeight=20;
function initMarquee() {
var str=marqueeContent[0];
document.write(‘‘+str+‘
‘);
marqueeId++;
marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {
var str=marqueeContent[marqueeId];
marqueeId++;
if(marqueeId>=marqueeContent.length) marqueeId=0;
if(document.getElementById("marqueeBox").childNodes.length==1) {
var nextLine=document.createElement(‘DIV‘);
nextLine.innerHTML=str;
document.getElementById("marqueeBox").appendChild(nextLine);
}
else {
document.getElementById("marqueeBox").childNodes[0].innerHTML=str;
document.getElementById("marqueeBox").appendChild(document.getElementById("marqueeBox").childNodes[0]);
document.getElementById("marqueeBox").scrollTop=0;
}
clearInterval(marqueeInterval[1]);
marqueeInterval[1]=setInterval("scrollMarquee()",20);
}
function scrollMarquee() {
document.getElementById("marqueeBox").scrollTop++;
if(document.getElementById("marqueeBox").scrollTop%marqueeHeight==(marqueeHeight-1)){
clearInterval(marqueeInterval[1]);
}
}
initMarquee();
script>
body>
html>
多行数据滚动显示_html5
标签:tee htm 标题 flow doc bsp code title ack
原文地址:https://www.cnblogs.com/zj68/p/12709716.html
上一篇:【PHP】PHP编码规范
评论
亲,登录后才可以留言!