1、来回滚动
<marquee behavior=" alternate "><font color=red>文字来回滚动 </marquee >
实际效果:
文字来回滚动
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />2、向一边滚动
<marquee><font color=#颜色代码>文字向一边滚动 </marquee >
实际效果:
文字向一边滚动
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3、走走停停
<marquee scrolldelay=500 scrollamount=100>文字走走停停 </marquee>
实际效果:
文字走走停停
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4、只走几趟<以3趟为例)
<marquee loop=3 width=50% behavior=scroll >文字只走3趟 </marquee>
实际效果:
文字只走3趟
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5、选定滚动方向
<marquee direction=left >文字自右向左移 </marquee>
实际效果:
文字自右向左移
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=right >文字自左向右移 </marquee>
实际效果:
文字自左向右移~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee scrollamount=8>
文字很快滚。
</marquee>
文字很快滚。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee scrollamount=1>
文字很慢滚。
</marquee>
文字很慢滚。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee .stop<> .start<> >
鼠标放上去停止滚动,移开继续滚动。
</marquee>
鼠标放上去停止滚动,移开继续滚动。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=left scrollamount=3>
文字向左滚。
</marquee>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=left scrollamount=3>
文字向左滚。
</marquee>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=left scrollamount=3>
文字向左滚。
</marquee>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=left scrollamount=3>
文字向左滚。
</marquee>
文字向左滚。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=right scrollamount=3>
文字向右滚。
</marquee>
文字向右滚。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=up scrollamount=3>
文字向上滚。
</marquee>
文字向上滚。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee direction=down scrollamount=3>
文字向下滚。
</marquee>
文字向下滚。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee scrollamount=3 behavior=alternate>
文字来回滚。
</marquee>
文字来回滚。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee scrolldelay=500 scrollamount=100>走一步,停一停!</marquee>
走一步,停一停!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<marquee bgcolor=aaaaee>设置底色的文字</marquee>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
文字向上移动代码:
<*marquee scrollamount=2 direction=up><*font color=#00000 size=4>欢迎您<*/font><*/marquee>
欢迎您
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
文字向下移动代码:
<*marquee scrollamount=2 direction=down><*font color=#02595 size=4>欢迎您<*/font><*/marquee>
欢迎您
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
文字向左移动代码:
<*marquee scrollamount=2 direction=LEFT><*font color=#00000 size=4>欢迎您<*/font><*/marquee>
欢迎您
文字向右移动代码:
<*marquee scrollamount=2 direction=RIGHT><*font color=#00000 size=4>欢迎您<*/font><*/marquee>
1.建立第一个滚动字幕。代码:
<marquee scrollAmount=2 width=300>靓丽风景线</marquee>
效果如: 靓丽风景线
2.各参数详解:
a)scrollAmount。它表示速度,值越大速度越快。如果没有它,默认为6,建议设为1~3比较好。
b)width和height,表示滚动区域的大小,width是宽度,height是高度。特别是在做垂直滚动的时候,一定要设height的值。
c)direction。表示滚动的方向,默认为从右向左:←←←。可选的值有right、down、up。滚动方向分别为:right表示→→→,up 表示↑,down表示↓。
d)scrollDelay,这也是用来控制速度的,默认为90,值越大,速度越慢。通常scrollDelay是不需要设置的。
e)behavior。用它来控制属性,默认为循环滚动,可选的值有alternate(交替滚动)、slide(幻灯片效果,指的是滚动一次,然后停止 滚动)
3.实例:
a)如何给滚动字幕加超链接?这跟平时的超链接是完全一样的。只要在文字外面加上<a href=***>和</a>就可以了。如下效果,代码是<marquee scrollAmount=2 width=300><a href=http://www.cctv.dengni.org>中央电视台</a></marquee>,点击中央电视台就可以进入 了:
中央电视台
b)如何制作当鼠标停留在文字上,文字停止滚动?
代码如:
<marquee scrollAmount=2 width=300 onmouseover=stop() onmouseout=start()>文字内容</marquee>
效果如:
文字内容
c)交替效果。代码如:
<marquee scrollAmount=2 width=99 behavior=alternate>文字内容</marquee>
效果如:
文字内容
d)多行文本向上滚动。代码如:
<marquee scrollAmount=2 width=300 height=160 direction=up>·早晨好啊!<br>·空气好清新啊<br>·你还好吗<p>·<a href=http://www.cctv.dengni.org>靓丽风景线</a></marquee>
效果如:
·早晨好啊!
·空气好清新啊
·你还好吗
·靓丽风景线
·注意:如果你的网页经过了FrontPage编辑,保存之后,只能滚动一行,这时候你发现你原 来的代码顺序已经变了,My god!解决的办法是,找出原来的代码,把它嵌入到JavaScript的document.write中即可,上述代码写为:
<script>document.write('<marquee scrollAmount=2 width=300 height=160 direction=up>·早晨好啊!<br>·空气好清新啊<br>·你还好吗 <p>·<a href=http://www.cctv.dengni.org>靓丽风景线</a></marquee>')< /script>
e)改变滚动字幕的颜色?可以用样式表来控制。如下效果,代码是<marquee scrollAmount=2 width=300><a style=color:CC6600>你还好吗</a></marquee>。
你还好吗





