文字或图片滚动代码

更新时间:2023-09-02 20:25:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

文字或图片滚动代码 信息来自网络

<marquee behavior=scroll direction=left width=400 height=150 scrollamount=5 scrolldelay=10 onclick=this.start() onmouseover=this.stop() onmouseout=this.start()>
<script language=javascript>
for (t=1;t<=1000;t++)
document.write("我要飞的更高,飞的更高。")
</script>
</marquee>
<DIV style="FILTER: glow(color=#000000 ,strength=1); COLOR: #000000; HEIGHT: 10px"><FONT size=3>
<MARQUEE style="WIDTH: 213px; HEIGHT: 120px" scrollAmount=1 scrollDelay=1 direction=up width=213 height=120>
<P align=left>公 告 : <BR><BR>本 blog 的 文 章 <BR><BR>纯 属 原 创 <BR><BR>未 经 本 人许可 <BR><BR>不 得 擅 自 转 载 <BR><BR></P></FONT></MARQUEE></FONT></DIV>





<br>&nbsp;</p>
<marquee direction=up height=40 scrollAmount=3 scrollDelay=150 width=400>
<center><font color=#ffaa00 face=黑体 size=5><font color=#ffaa00>如果你听见风中有些动静,</font></font></center>
<center><font color=#ffaa00 face=黑体 size=5><font color=#ffaa00>可能是我在想你...</font></font></center>
<center><font color=#ffaa00 face=黑体 size=5><font color=#ffaa00>如果你发现梦中有些迷语,</font></font></center>
<center><font color=#ffaa00 face=黑体 size=5><font color=#ffaa00>就是我在呼唤你...</center></font></font></marquee>
<p>&nbsp;</p>



</marquee>

<div style="filter: glow(color=#000000 ,strength=1); color: #000000; height: 10px"><font size="3">
<marquee style="WIDTH: 213px; HEIGHT: 120px" scrollamount="1" scrolldelay="1" direction="up" width="213" height="120">
<p align="left">公 告 : <br/><br/>这里是文字 <br/><br/>滚动字幕内容 <br/><br/>滚动字幕内容 <br/><br/>滚动字幕内容 <br/><br/></p></marquee>
</div>




文字无空隙滚动
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.77cn.com.cn/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.77cn.com.cn/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>文字列表无缝向上滚动JavaScript代码</title>
<style>
*{margin:0px;padding:0px;border:0px;}
body{font-size:12px}
#demo1{
height:auto;
text-align:left;
}
#demo2{
height:auto;
text-align:left;
}
#demo1 li{
list-style-type:none;
height:22px;
background:url() no-repeat left center;
text-align:left;
text-indent:15px;
}
#demo2 li{
list-style-type:none;
height:22px;
background:url() no-repeat left center;
text-align:left;
text-indent:15px;
}
</style>
</head>
<body>
<div id="demo" style="overflow:hidden;height:80px;width:280px;">
<ul id="demo1">
<li><a href="/soft/4085.shtml" target="_blank">XP Menu 仿QQ菜单管理器左侧菜单</a></li><li><a href="/soft/5884.shtml" target="_blank">多层嵌套的一个层展开</a></li><li><a href="/soft/1852.shtml" target="_blank">《Java2核心技术卷2:高级特性》第7版</a></li><li><a href="/soft
/1286.shtml" target="_blank">CSS、HTML教程打包下载 (CHM)</a></li><li><a href="/soft/4216.shtml" target

文字或图片滚动代码 信息来自网络

="_blank">《C++ Primer》中文第四版 chm</a></li><li><a href="/soft/3388.shtml" target="_blank">C++工资管理系统(Access)</a></li><li><a href="/soft/2009.shtml" target="_blank">非常牛的左侧栏JS折叠菜单</a></li>
</ul>
<div id="demo2"></div>
</div>
<script>
var speed=40
var demo=document.getElementById("demo");
var demo2=document.getElementById("demo2");
var demo1=document.getElementById("demo1");
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
</body>
</html>



<div id="marquees">
<a href="#">你可曾有过无数的梦想,</a><br>
<br>
<a href="#">却在时光的流逝里幻灭 </a><br>
<br>
<a href="#">你可曾对未来期待憧憬,</a><br>
<br>
<a href="#">却在成长的岁月中迷失</a><br>
<br>
</div>
<script language="JavaScript">
marqueesHeight=200;
stopscroll=false;
with(marquees){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
preTop=0; currentTop=0;
function init(){
templayer.innerHTML="";
while(templayer.offsetHeight<marqueesHeight){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollUp()",10);
}
document.body.onload=init;
function scrollUp(){
if(stopscroll==true) return;
preTop=marquees.scrollTop;
marquees.scrollTop+=1;
if(preTop==marquees.scrollTop){
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
marquees.scrollTop+=1;
}

本文来源:https://www.bwwdw.com/article/ji8i.html

Top