HTML Marquee 字符片段滾動

字號:


    HTML(Marquee字符片段滾動),建議用js實(shí)現(xiàn)的代碼。因?yàn)榭梢詫?shí)現(xiàn)不間斷的滾動。不過學(xué)習(xí)用用還是不錯的。
    以下其屬性:
    direction
    設(shè)定活動字幕的滾動方向
    代碼如下:
    <marquee direction="down">設(shè)定活動字幕的滾動方向direction="down":向下</marquee>
    <marquee direction="left">設(shè)定活動字幕的滾動方向direction="left":向左</marquee>
    <marquee direction="right">設(shè)定活動字幕的滾動方向direction="right":向右</marquee>
    <marquee direction="up">設(shè)定活動字幕的滾動方向direction="up":向上</marquee>
    behavior
    設(shè)定滾動的方式:
    alternate: 表示在兩端之間來回滾動。
    scroll: 表示由一端滾動到另一端,會重復(fù)。
    slide: 表示由一端滾動到另一端,不會重復(fù)。
    代碼如下:
    <marquee behavior="alternate">alternate:表示在兩端之間來回滾動。 </marquee>
    <marquee behavior="scroll">scroll:表示由一端滾動到另一端,會重復(fù)。</marquee>
    <marquee behavior="slide">slide: 表示由一端滾動到另一端,不會重復(fù)。</marquee>
    scrollamount
    設(shè)定活動字幕的滾動速度,單位pixels
    代碼如下:
    <marquee scrollamount="10" >scrollamount="10" </marquee>
    <marquee scrollamount="20" >scrollamount="20" </marquee>
    <marquee scrollamount="30" >scrollamount="30" </marquee>
    scrolldelay
    設(shè)定活動字幕滾動兩次之間的延遲時間,單位millisecond(毫秒)
    值大了會有一步一停頓的效果
    代碼如下:
    <marquee scrolldelay="10" >scrolldelay="10" </marquee>
    <marquee scrolldelay="100" > scrolldelay="100"</marquee>
    <marquee scrolldelay="1000">scrolldelay="1000" </marquee>