鼠标属性
onMouseOut=this.start() ........鼠标移出状态滚动onMouseOver=this.stop() .........鼠标经过时停止滚动方向<direction=#> #=left, right ,up ,down <marquee direction=left>从右向左移!</marquee>方式<bihavior=#> #=scroll, slide, alternate <marquee behavior=scroll>一圈一圈绕着走!</marquee><marquee behavior=slide>只走一次就歇了!</marquee><marquee behavior=alternate>来回走</marquee>循环<loop=#> #=次数;若未指定则循环不止(infinite) <marquee loop=3 width=50% behavior=scroll>只走 3 趟</marquee>
<marquee loop=3 width=50% behavior=slide>只走 3 趟</marquee><marquee loop=3 width=50% behavior=alternate>只走 3 趟!</marquee>速度<scrollamount=#> <marquee scrollamount=20>啦啦啦,我走得好快哟!</marquee>延时<scrolldelay=#> <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>外观(Layout)设置对齐方式(Align)<align=#> #=top, middle, bottom <font size=6><marquee align=# width=400>啦啦啦,我会移动耶!</marquee></font>底色<bgcolor=#> #=rrggbb 16 进制数码,或者是下列预定义色彩:Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,Fuchsia, White, Green, Purple, Silver, Yellow, Aqua <marquee bgcolor=aaaaee>颜色!</marquee>面积<height=# width=#> <marquee height=40 width=50% bgcolor=aaeeaa>面积!</marquee>空白(Margins)<hspace=# vspace=#><marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>面积!</marquee>
1 方向#=left, right ,up ,down 2 方式 #=scroll, slide, alternate 3 循环 #=次数;若未指定则循环不止(infinite) 4 5 6 7 速度 8 延时 9 外观(Layout)设置10 对齐方式(Align) #=top, middle, bottom 11 底色 #=rrggbb 16 进制数码,或者是下列预定义色彩:Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,Fuchsia, White, Green, Purple, Silver, Yellow, Aqua 12 面积 13 空白(Margins)
从右向左移! 一圈一圈绕着走!只走一次就歇了!来回走 只走 3 趟 4 5 6 只走 3 趟只走 3 趟! 7 速度<scrollamount=#> 啦啦啦,我走得好快哟! 8 延时<scrolldelay=#> 啦啦啦,我走一步,停一停! 9 外观(Layout)设置 10 对齐方式(Align)<align=#> #=top, middle, bottom 啦啦啦,我会移动耶! 11 底色<bgcolor=#> #=rrggbb 16 进制数码,或者是下列预定义色彩:Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,Fuchsia, White, Green, Purple, Silver, Yellow, Aqua 颜色! 12 面积<height=# width=#> 面积! 13 空白(Margins)<hspace=# vspace=#>面积! <direction=#> #=left, right ,up ,down 从右向左移!
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.com>中央电视台</a></marquee>,点击中央电视台就可以进入 了:b)如何制作当鼠标停留在文字上,文字停止滚动?
代码如: <marquee scrollAmount=2 width=300 οnmοuseοver=stop() οnmοuseοut=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.com>中央电视台</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.com>中央电视台</a></marquee>')< /script>e)改变滚动字幕的颜色?可以用样式表来控制。如下效果,代码是<marquee scrollAmount=2 width=300><a style=color:CC6600>我钟意网页树树!</a></marquee>。
此篇文章属于转载:请访问出处:http://x.discuz.net/200278/viewspace-3737