HTML标签-marquee

来源:互联网 发布:游戏程序员面试 编辑:程序博客网 时间:2024/04/30 20:36

         在看JavaScript实现幻灯片效果的时候,偶然发现了HTML的marquee标签,可以实现滚动的效果。

语法:<marquee></marquee>

标签属性:

1、滚动方向:direction。可选值为:up、down、right、left。

              例如:direction="up"

 2、滚动速度:scrollamount。值为数字。滚动速度是设置每次滚动时移动的长度,以像素为单位。

               例如:scrollamount="2"

3、滚动延迟:scrolldelay。设置滚动时的时间间隔,以毫秒为单位。

例如:scrolldelay="1000"

4、滚动方式behavior。可选值为:scroll(循环滚动,默认效果); slide(滚动一次就停止); alternate(来回交替进行滚动)。

例如:behavior="slide"

5、滚动循环loop。值为数字。默认值是-1,滚动会不断的循环下去。

例如: loop="2"

6、width、height属性

例如:<marquee width="500" height="100"></marquee>

marquee有两个经常用到的事件:

             onMouseOver="this.stop()"  鼠标移入该区域时

            onMouseOut="this.start()"   鼠标移出该区域时

示例为:

<marquee direction="down"  scrollamount="2"  scrolldelay="2000"  behavior="alternate"  loop="-1" width="200"  height="100">我要交替滚动</marquee>





1 0
原创粉丝点击