设为首页收藏本站

嘻皮客娱乐学习网

 找回密码
 中文注册
搜索
打印 上一主题 下一主题
开启左侧

[网页制作] marquee(文字滚动)详解

[复制链接]
跳转到指定楼层
楼主
发表于 2014-10-29 16:35:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
marquee(文字滚动)详解

                                                                                               
                    marquee(文字滚动)详解,这个滚动效果不是很经常用,但是偶尔也可以用到,下面讲解一下marquee的参数

文字滚动是由<marquee></marquee>控制的。marquee的参数如下:

1、方向 <direction=#> #=left, right
如:<marquee direction=left>啦啦啦,我从右向左移!</marquee>
<marquee direction=right>啦啦啦,我从左向右移!</marquee>

2、方式 <bihavior=#> #=scroll, slide, alternate
如:<marquee behavior=scroll>啦啦啦,我一圈一圈绕着走!</marquee>
<marquee behavior=slide>啦啦啦,我只走一次就歇了!</marquee>
<marquee behavior=alternate>啦啦啦,我来回走耶!</marquee>

3、循环 <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>

4、速度 <scrollamount=#>
如:<marquee scrollamount=20>啦啦啦,我走得好快哟!</marquee>

5、延时 <scrolldelay=#>
如: <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>

6、对齐方式(Align) <align=#> #=top, middle, bottom
如:<font size=6>
<marquee align=# width=400>啦啦啦,我会移动耶!</marquee>
</font>
7、底色 <bgcolor=#>
#=rrggbb 16 进制数码,或者是下列预定义色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua

如:<marquee bgcolor=aaaaee>啦啦啦,我会移动耶!</marquee>

8、面积 <height=# width=#>
如:<marquee height=40 width=50% bgcolor=aaeeaa> 啦啦啦,我会移动耶!</marquee>

9、空白(Margins)<hspace=# vspace=#>

<marquee   id="scrollarea"   direction="up"   scrolldelay="10"   scrollamount="1"   width="150"   height="80"      >
------------------------------------------------------------------------------------------------------------------------------
<marquee></marquee>
以下是一个最简单的例子:
代码如下:
<marquee><font size=+3 color=red>Hello, World</font></marquee>

下面这两个事件经常用到:
:用来设置鼠标移出该区域时继续滚动
:用来设置鼠标移入该区域时停止滚动
代码如下:
<marquee > :用来设置鼠标移出该区域时继续滚动 :用来设置鼠标移入该区域时停止滚动</marquee>

这是一个完整的例子:
代码如下:
<marquee align="left" behavior="scroll" bgcolor="#FF0000" direction="up" height="300" width="200" hspace="50" vspace="20" loop="-1"scrollamount="10"scrolldelay="100" >
这是一个完整的例子
</marquee>
回复

使用道具 举报

小黑屋|手机版|嘻皮客网 ( 京ICP备10218169号|京公网安备11010802013797  

GMT+8, 2024-5-5 05:28 , Processed in 0.204488 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表