美文网首页
marquee标签(html滚动效果)

marquee标签(html滚动效果)

作者: 努力努力再努力jy | 来源:发表于2019-04-09 16:03 被阅读0次

1.behavior(滚动模式)

PS:可取scroll(单向循环)、alternate(来回滚动)、slide(单次滚动)

<marquee behavior="scroll">(默认)向左循环滚动</marquee>
<marquee behavior="alternate">来回滚动</marquee>
<marquee behavior="slide">左滚一次</marquee>

2.direction(方向)

PS:可取up,down,left,right,默认left

<marquee behavior="scroll" direction="right">向右循环滚动</marquee>

3.loop(循环控制)

PS:默认或-1或infinite无限循环,数值为循环次数,循环结束后内容会消失,样式依然存在

<marquee loop="3" bgcolor="red">循环3次后文字消失,背景依然存在</marquee>
<marquee loop="-1">无限循环</marquee>

4.scrollamount(滚动速度)、scrolldelay(停顿时间)

PS:scrollamount默认6,scrolldelay默认0,两者同时存在,听scrollamount的话

<marquee scrollamount="100">数值越大越快</marquee>
<marquee scrolldelay="10">数值越小越快</marquee>

5.start()(开始滚动)、stop()(停止滚动)

<marquee onmouseover="this.stop()" onmouseout="this.start()">鼠标移入停止,移出继续滚动</marquee>

相关文章