0
点赞
收藏
分享

微信扫一扫

HTML代码之Marquee详解

下面这两个事件经常用到:

onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动

onMouseOver="this.stop()":用来设置鼠标移入该区域时停止滚动

代码如下:

<marquee onMouseOut="this.start()" onMouseOver="this.stop()">onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动 onMouseOver="this.stop()":用来设置鼠标移入该区域时停止滚动</marquee>


该标签支持的属性多达11个:



align
设定<marquee>标签内容的对齐方式

absbottom:绝对底部对齐(与g、p等字母的最下端对齐)

absmiddle:绝对中央对齐

baseline:底线对齐

bottom:底部对齐(默认)

left:左对齐

middle:中间对齐

right:右对齐

texttop:顶线对齐

top:顶部对齐


behavior
设定滚动的方式:
alternate: 表示在两端之间来回滚动。

scroll: 表示由一端滚动到另一端,会重复。

slide:  表示由一端滚动到另一端,不会重复。


direction
设定活动字幕的滚动方向

代码如下:

<marquee direction="down">设定活动字幕的滚动方向direction="down":向下</marquee>

<marquee direction="left">设定活动字幕的滚动方向direction="left":向左</marquee>

<marquee direction="right">设定活动字幕的滚动方向direction="right":向右</marquee>

<marquee direction="up">设定活动字幕的滚动方向direction="up":向上</marquee>


height

设定活动字幕的高度

width

设定活动字幕的宽度



hspace

设定活动字幕里所在的位置距离父容器水平边框的距离

This controls the horizontal(水平)space around the display box.

代码如下:

  <table width="500" border="1" align="center" cellpadding="0" cellspacing="0">

    <tr>

      <td><marquee hspace="100" bgcolor="#CCCCCC">hspace="100"</marquee></td>

    </tr>

  </table>



vspace

设定活动字幕里所在的位置距离父容器垂直边框的距离

This controls the vertical(垂直) space around the display box.

代码如下:

<marquee vspace="100" bgcolor="#CCCCCC">hspace="100"</marquee>


loop

设定滚动的次数,当loop=-1表示一直滚动下去,默认为-1

代码如下:

<marquee loop="-1" bgcolor="#CCCCCC">我会不停地走。</marquee>

<p>&nbsp;</p>

<marquee loop="2" bgcolor="#CCCCCC">我只走两次哦</marquee>



scrollamount

设定活动字幕的滚动速度,单位pixels

代码如下:

<marquee scrollamount="10" >scrollamount="10" </marquee>

<marquee scrollamount="20" >scrollamount="20" </marquee>

<marquee scrollamount="30" >scrollamount="30" </marquee>



scrolldelay

设定活动字幕滚动两次之间的延迟时间,单位millisecond(毫秒)

值大了会有一步一停顿的效果

代码如下:

<marquee scrolldelay="10" >scrolldelay="10" </marquee>

<marquee scrolldelay="100" > scrolldelay="100"</marquee>

<marquee scrolldelay="1000">scrolldelay="1000" </marquee>




举报

相关推荐

0 条评论