`

JS 滚动字幕

    博客分类:
  • web
阅读更多

<marquee
align=left|center|right|top|bottom
bgcolor=#n
direction=left|right|up|down
behavior=type
height=n
hspace=n
scrollamount=n
Scrolldelay=n
width=n
VSpace=n
loop=n>内容</marquee>
各参数详解:
align:是设定活动字幕的位置,除了居左、居中、居右三种位置外,又增加靠上(top)和靠下(bottom)两种位置。
Bgcolor:用于设定活动字幕的背景颜色,可以使用英文的单词也可以是十六进制数的。
Direction:用于设定活动字幕的滚动方向是向左(left)、向右(right)、向上(up)、向下(down)。
Behavior:用于设定滚动的方式,主要由三种方式:
     behavior="scroll"表示由一端滚动到另一端;
     behavior="slide":表示由一端快速滑动到另一端,且不再重复;
     behavior="alternate"表示在两端之间来回滚动。
Height:用于设定滚动字幕的高度。
Width:则设定滚动字幕的宽度。
Hspace和vspace:分别用于设定滚动字幕的左右边框和上下边框的宽度。
Scrollamount:用于设定活动字幕的滚动距离。数值越小,滚动的速度就越快。默认为6,建议设为1~3比较好
scrolldelay:用于设定滚动两次之间的延迟时间,数值越小,间隔就越小。
Loop:用于设定滚动的次数,当loop=-1表示一直滚动下去,直到页面更新。其中默认情况是向左滚动无限次,字幕高度是文本高度;滚动范围:水平滚动的宽度是当前位置的宽度;垂直滚动的高度是当前位置的高度。

<onmouseover=stop() onmouseout=start()>鼠标事件

一个实例:
<marquee
align=left
direction=up
behavior=scroll
height=72
scrollamount=2
Scrolldelay= 1
loop=-1
onmouseover=stop()
onmouseout=start()>
<div align="left">
<%if(marryds.first()){
do{%>
<img src="images/hot1.gif"><a href="../marryindex.jsp?myid=<%=ds.getString("sequenceid")%> "class="jh">
<%=CodeChange.subStr(marryds.getString("text"),20)%> </a> <br>
<%}while(marryds.next());
}
%>
</div>
</marquee>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics