在html中出了用<marquee direction=up>向上滚动的代码还有没有别的可以用的向上滚动的代码
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在html中出了用<marquee direction=up>向上滚动的代码还有没有别的可以用的向上滚动的代码相关的知识,希望对你有一定的参考价值。
文字
参考技术A marquee只能作用于IE浏览器,下面的代码兼容所有浏览器 <html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>向上无缝滚动</title>
</head><body>
<div id=demo style="overflow:hidden; width:191px; height:140px;">
<div id=demo1>
<table width="191" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_255.html>Congratulations! some tools are free shipping now!</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_254.html>Tacho Universal without times limitation</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_253.html>Latest version - Mercedes Benz Star 3/2009</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_252.html>BMW GT1 suits for any computers now!</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_251.html>New comer - Nissan Consult III</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_250.html>Update software - X431 & X431 TOOL 6/17/2009</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_249.html>Updated version - AK500 BENZ/BMW Key Programmer</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_248.html>Latest version - OP-COM v10/2008</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_247.html>New comer - Honda FLY100</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_246.html>New comer - Honda Airbag Resetter</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_245.html>TOYOTA ITIS come out</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_244.html>Latest version - VAG K CAN Commander 3.0</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
<tr>
<td height="19" width="10" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19"><img src="/images/dian.gif" width="4" height="4"/></td>
</tr>
</table>
</td>
<td align="left"><span class="STYLE4"><a href=/html/News/news_243.html>Latest version - Lexia3 Citroen/Peugeot</a></span></td>
</tr>
<tr>
<td height="10">
</td>
</tr>
</table>
</div>
<div id=demo2></div>
</div>
<script language="javascript">
var speed=40
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>
marquee实现滚动效果
页面的自动滚动效果,可由javascript来实现,但是今天无意中发现了一个html标签 - <marquee></marquee>可以实现多种滚动效果,无需js控制。
使用marquee标记不仅可以移动文字,也可以移动图片,表格等.
语法:<marquee>...</marquee>; 说明:在标记之间添加要进行滚动的内容。
重要属性:
1.滚动方向direction(包括4个值:up、 down、 left和 right)
语法:<marquee direction="滚动方向">...</marquee>
2.滚动方式behavior(scroll:循环滚动,默认效果; slide:只滚动一次就停止; alternate:来回交替进行滚动)
语法:<marquee behavior="滚动方式">...</marquee>
3.滚动速度scrollamount(滚动速度是设置每次滚动时移动的长度,以像素为单位)
语法:<marquee scrollamount="5">...</marquee>
4.滚动延迟scrolldelay(设置滚动的时间间隔,单位是毫秒)
语法:<marquee scrolldelay="100">...</marquee>
5.滚动循环loop(默认值是-1,滚动会不断的循环下去)
语法:<marquee loop="2">...</marquee>
6.滚动范围width、height
7.滚动背景颜色bgcolor
8.空白空间hspace、vspace
代码实例:
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <title>无标题文档</title> 6 </head> 7 8 <body> 9 <div> 10 <marquee direction="up" behavior="scroll" scrollamount="1" scrolldelay="0" loop="-1" width="1000" height="50" bgcolor="#0099FF" hspace="10" vspace="10"> 11 指整个Marquee对齐方式; (2)behavior:设置滚动的方式: scroll:表示由一端滚动到另一端,会重复,缺陷是不能无缝滚动。 slide:表示由一段滚动到另一端,不会重复... 12 </marquee> 13 </div> 14 </body> 15 </html>
以上是关于在html中出了用<marquee direction=up>向上滚动的代码还有没有别的可以用的向上滚动的代码的主要内容,如果未能解决你的问题,请参考以下文章
2016/2/26 <marquee></marquee>实现多种滚动效果