html一段文字上下滚动代码,html下载链接代码怎么写
大家好,如果您还对html一段文字上下滚动代码不太了解,没有关系,今天就由本站为大家分享html一段文字上下滚动代码的知识,包括html下载链接代码怎么写的问题都会给大家分析到,还望可以解决大家的问题,下面我们就开始吧!
html滚动文字代码是什么
<marquee direction=up behavior=scroll loop=3 scrollamount=1 scrolldelay=10 align=top bgcolor=#ffffff height=300 width=30% hspace=20 vspace=10 onmouseover=this.stop() onmouseout=this.start()>此处输入滚动内容</marquee>
◎ direction表示滚动的方向,值可以是left,right,up,down,默认为left
◎ behavior表示滚动的方式,值可以是scroll(连续滚动)slide(滑动一次)alternate(往返滚动)
◎ loop表示循环的次数,值是正整数,默认为无限循环
◎ scrollamount表示运动速度,值是正整数,默认为6
◎ scrolldelay表示停顿时间,值是正整数,默认为0,单位似乎是毫秒
◎ align表示元素的垂直对齐方式,值可以是top,middle,bottom,默认为middle
◎ bgcolor表示运动区域的背景色,值是16进制的RGB颜色,默认为白色
◎ height、width表示运动区域的高度和宽度,值是正整数(单位是像素)或百分数,默认width=100% height为标签内元素的高度
◎ hspace、vspace表示元素到区域边界的水平距离和垂直距离,值是正整数,单位是像素。
◎ onmouseover=this.stop() onmouseout=this.start()表示当鼠标以上区域的时候滚动停止,当鼠标移开的时候又继续滚动。
网页设计文字滚动(水平)代码
网页设计文字滚动(水平)代码是:
<marqueedirection=up=1scrolldelay=100
height=60>
共和国
扩展资料:一、除此之外,marquee参数有以下:
BGColor:滚动文本框的背景颜色。
Direction:滚动方向设置,可选择Left、Right、up和down。
scrolldelay:每轮滚动之间的延迟时间,越大越慢。
:一次滚动总的时间量,数字越小滚动越慢。
Behaviour:滚动的方式设置,三种取值:Scroll(循环滚动)lide(单次滚动)、Alternate(来回滚动)。
Align:文字的对齐方式设置。可选择Middle(居中)、Bottom(居下)还是Top(居上)。
Width:滚动文本框的宽度,输入一个数值后从后面的单选框选择inPixels(按像素)或是inPercent(按百分比)。
Height:滚动文本框的高度,输入一个数值后从后面的单选框选择inPixels(按像素)或是inPercent(按百分比)。
loop:滚动次数。默认为infinite
hspace、vspace:前后、上下的空行。
二、滚动字幕在FrontPage的组件里有,但是FrontPage这个软件只能支持单行文字,一出现多行文字它就无能为力了,而且它只能支持一行滚动。(如果出现只能滚动一行的情况,解决办法是把这段代码嵌入到JavaScript的document.write里面。)
求文字向上无限循环滚动代码,无缝隙循环,要HTML的。
<!DOCTYPE>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>向上下左右不间断无缝滚动效果(兼容火狐和IE)</title>
</head>
<body>
<divid="colee"style="overflow:hidden;height:253px;width:410px;">
<divid="colee1">
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
<p>此处放文字。。。。。。。。。</p>
</div>
<divid="colee2"></div>
</div>
<script>
varspeed=30;
varcolee2=document.getElementById("colee2");
varcolee1=document.getElementById("colee1");
varcolee=document.getElementById("colee");
colee2.innerHTML=colee1.innerHTML;//克隆colee1为colee2
functionMarquee1(){
//当滚动至colee1与colee2交界时
if(colee2.offsetTop-colee.scrollTop<=0){
colee.scrollTop-=colee1.offsetHeight;//colee跳到最顶端
}else{
colee.scrollTop++
}
}
varMyMar1=setInterval(Marquee1,speed)//设置定时器
//鼠标移上时清除定时器达到滚动停止的目的
colee.onmouseover=function(){clearInterval(MyMar1)}
//鼠标移开时重设定时器
colee.onmouseout=function(){MyMar1=setInterval(Marquee1,speed)}
</script>
<!--向上滚动代码结束-->
<br>
<!--下面是向下滚动代码-->
<divid="colee_bottom"style="overflow:hidden;height:253px;width:410px;">
<divid="colee_bottom1">
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
<p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p>
</div>
<divid="colee_bottom2"></div>
</div>
<script>
varspeed=30
varcolee_bottom2=document.getElementById("colee_bottom2");
varcolee_bottom1=document.getElementById("colee_bottom1");
varcolee_bottom=document.getElementById("colee_bottom");
colee_bottom2.innerHTML=colee_bottom1.innerHTML
colee_bottom.scrollTop=colee_bottom.scrollHeight
functionMarquee2(){
if(colee_bottom1.offsetTop-colee_bottom.scrollTop>=0)
colee_bottom.scrollTop+=colee_bottom2.offsetHeight
else{
colee_bottom.scrollTop--
}
}
varMyMar2=setInterval(Marquee2,speed)
colee_bottom.onmouseover=function(){clearInterval(MyMar2)}
colee_bottom.onmouseout=function(){MyMar2=setInterval(Marquee2,speed)}
</script>
<!--向下滚动代码结束-->
<br>
<!--下面是向左滚动代码-->
<divid="colee_left"style="overflow:hidden;width:500px;">
<tablecellpadding="0"cellspacing="0"border="0">
<tr><tdid="colee_left1"valign="top"align="center">
<tablecellpadding="2"cellspacing="0"border="0">
<tralign="center">
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
</tr>
</table>
</td>
<tdid="colee_left2"valign="top"></td>
</tr>
</table>
</div>
<script>
//使用div时,请保证colee_left2与colee_left1是在同一行上.
varspeed=30//速度数值越大速度越慢
varcolee_left2=document.getElementById("colee_left2");
varcolee_left1=document.getElementById("colee_left1");
varcolee_left=document.getElementById("colee_left");
colee_left2.innerHTML=colee_left1.innerHTML
functionMarquee3(){
if(colee_left2.offsetWidth-colee_left.scrollLeft<=0)//offsetWidth是对象的可见宽度
colee_left.scrollLeft-=colee_left1.offsetWidth//scrollWidth是对象的实际内容的宽,不包边线宽度
else{
colee_left.scrollLeft++
}
}
varMyMar3=setInterval(Marquee3,speed)
colee_left.onmouseover=function(){clearInterval(MyMar3)}
colee_left.onmouseout=function(){MyMar3=setInterval(Marquee3,speed)}
</script>
<!--向左滚动代码结束-->
<br>
<!--下面是向右滚动代码-->
<divid="colee_right"style="overflow:hidden;width:500px;">
<tablecellpadding="0"cellspacing="0"border="0">
<tr><tdid="colee_right1"valign="top"align="center">
<tablecellpadding="2"cellspacing="0"border="0">
<tralign="center">
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
<td><p><imgsrc="/jscss/demoimg/200907/bg3.jpg"></p></td>
</tr>
</table>
</td>
<tdid="colee_right2"valign="top"></td>
</tr>
</table>
</div>
<script>
varspeed=30//速度数值越大速度越慢
varcolee_right2=document.getElementById("colee_right2");
varcolee_right1=document.getElementById("colee_right1");
varcolee_right=document.getElementById("colee_right");
colee_right2.innerHTML=colee_right1.innerHTML
functionMarquee4(){
if(colee_right.scrollLeft<=0)
colee_right.scrollLeft+=colee_right2.offsetWidth
else{
colee_right.scrollLeft--
}
}
varMyMar4=setInterval(Marquee4,speed)
colee_right.onmouseover=function(){clearInterval(MyMar4)}
colee_right.onmouseout=function(){MyMar4=setInterval(Marquee4,speed)}
</script>
<!--向右滚动代码结束-->
</body>
</html>
OK,本文到此结束,希望对大家有所帮助。