基本文法
<marquee> ... </marquee>
移動屬性的設定 ,這種移動不僅僅局限於文字,也可以應用於圖片,表格等等
方向
<direction=#> #=left, right ,up ,down <marquee direction=left>從右向左移!</marquee>
方式
<bihavior=#> #=scroll, slide, alternate <marquee behavior=scroll>一圈一圈繞著走!</marquee>
<marquee behavior=slide>只走一次就歇了!</marquee>
<marquee behavior=alternate>來回走</marquee>
迴圈
<loop=#> #=次數;若未指定則迴圈不止(infinite) <marquee loop=3 width=50% behavior=scroll>只走 3 趟</marquee> <P>
<marquee loop=3 width=50% behavior=slide>只走 3 趟</marquee>
<marquee loop=3 width=50% behavior=alternate>只走 3 趟!</marquee>
速度
<scrollamount=#> <marquee scrollamount=20>啦啦啦,我走得好快喲!</marquee>
延時
<scrolldelay=#> <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>
外觀(Layout)設定
對齊(Align)
<align=#> #=top, middle, bottom <font size=6>
<marquee align=# width=400>啦啦啦,我會移動耶!</marquee>
</font>
底色
<bgcolor=#> #=rrggbb 16 進位數位,或者是下列預定義色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua <marquee bgcolor=aaaaee>顏色!</marquee>
面積
<height=# width=#> <marquee height=40 width=50% bgcolor=aaeeaa>面積!</marquee>
空白
(Margins)<hspace=# vspace=#>
<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>面積!</marquee>
方向
<direction=#> #=left, right ,up ,down <marquee direction=left>從右向左移!</marquee>
方式
<bihavior=#> #=scroll, slide, alternate <marquee behavior=scroll>一圈一圈繞著走!</marquee>
<marquee behavior=slide>只走一次就歇了!</marquee>
<marquee behavior=alternate>來回走</marquee>
迴圈
<loop=#> #=次數;若未指定則迴圈不止(infinite) <marquee loop=3 width=50% behavior=scroll>只走 3 趟</marquee> <P>
<marquee loop=3 width=50% behavior=slide>只走 3 趟</marquee>
<marquee loop=3 width=50% behavior=alternate>只走 3 趟!</marquee>
速度
<scrollamount=#> <marquee scrollamount=20>啦啦啦,我走得好快喲!</marquee>
延時
<scrolldelay=#> <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>
外觀(Layout)設定
對齊(Align)
<align=#> #=top, middle, bottom <font size=6>
<marquee align=# width=400>啦啦啦,我會移動耶!</marquee>
</font>
底色
<bgcolor=#> #=rrggbb 16 進位數位,或者是下列預定義色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua <marquee bgcolor=aaaaee>顏色!</marquee>
面積
<height=# width=#> <marquee height=40 width=50% bgcolor=aaeeaa>面積!</marquee>
空白
(Margins)<hspace=# vspace=#>
<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>面積!</marquee>
====================
小技巧:
當滑鼠放在上面時就停止滾動,移開時又繼續滾動?
------------------------------------
<marquee id="li" onmouseover="this.stop()"
onmouseout="this.start()">滾動內容</marquee>
===============
一個執行個體:
效果:(asp.net中滾動datagrid,並且前面加連結圖片,當滑鼠放在上面時就停止滾動,移開時又繼續滾動)
執行個體代碼:
<TD style="WIDTH: 230px" vAlign="middle" align="left" height="100">
<marquee style="WIDTH: 220px; HEIGHT: 80px" direction="up" scrolldelay="300" onmouseover="this.stop()"
onmouseout="this.start()">
<asp:datagrid id="dgGongGao" runat="server" Width="100%" Height="76px" BorderWidth="0px" ShowHeader="False"
AutoGenerateColumns="False" GridLines="None" PageSize="100">
<Columns>
<asp:TemplateColumn HeaderText="公告標題">
<ItemTemplate>
<a target = _blank href ='<%# DataBinder.Eval(Container, "DataItem.公告編號", "gonggao.aspx?id={0}") %>'>
<img src="images/right.gif" border="0"> </a>
<asp:HyperLink runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.標題") %>' NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.公告編號", "gonggao.aspx?id={0}") %>' Target="_blank" ID="Hyperlink3">
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
</marquee> &p; <asp:hyperlink id="hlAllGongGao" runat="server" NavigateUrl="allgonggao.aspx" Target="_blank">全部公告>></asp:hyperlink>
</TD>