主要参数:

behavior 
  • 移动方式
    • scroll        循环移动
    • slide         只移动一个回合
    • alternate   来回移动
direction
  • 移动方向
    • left
    • right
    • up
    • down
 
scrollamount
  • 移动速度。取整数,数值越大速度越快
 
scrolldelay
  • 延时(走走停停)。毫秒为单位,默认85。如果设置小于60,会默认使用60,除非truespeed指定。
 
truespeed
  • 默认情况下,scrolldelay值低于60将被忽略。如果truespeed存在,这些值是不会忽略。
  
loop
  • 循环次数,默认一直循环
 
height     
width
bgcolor
 
效果图:
 
 
code :
<body style="text-align: center">
<div style="margin: 0 auto; background-color: beige; width: 300px; height: 300px; text-align: center; background-color: beige" >
    我是不动的
<!-- marquee 设置滚动 direction 滚动方向; scrollamount 移动速度; behavior移动方式  scroll(循环移动)、slide(只移动一个回合)、alternate(来回移动) -->
    <marquee>我是默认的滚动方向!</marquee>
    <marquee direction="up">我是向上的滚动!</marquee>
    <marquee style="border:solid" direction="down" scrollamount="3" height="200px" width="200px" behavior="alternate" bgcolor="azure" scrolldelay="10">
        <marquee behavior="alternate">
            <p style="background-color: aqua">我是嵌套的滚动</p>
        </marquee>
    </marquee>

</div>
</body>

 

 
 
 
posted on 2016-08-01 10:51  怡情_老二  阅读(272)  评论(0编辑  收藏  举报