常  海拔与大气压
用  管道推荐流速
资  常用符号汇总
料  饱和蒸汽性质
查  换热系数推荐
询  常见物质粘度

专题检索 管理入口


法规规范   ◆设计标准   ◆材料标准   ◆部件标准   ◆制造修理   ◆基础知识   ◆综合专题   ◆通用设备   ◆行业综合  
◆ 行业综合>>行业综合>>marquee 标签的鼠标放上去滚动效果 鼠标离开继续滚动
marquee 标签的鼠标放上去滚动效果 鼠标离开继续滚动
全文链接       2015/5/19  


效果很实用,可以轻松的实现鼠标放上去停止滚动、鼠标离开继续滚动的效果。下面是具体的用法(特别注意onMouseOver和onMouseOut是需要同时写进去才会出现比较好的效果):
onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动
onMouseOver="this.stop()":用来设置鼠标移入该区域时停止滚动

代码如下:
<marquee onMouseOut="this.start()" onMouseOver="this.stop()">onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动 onMouseOver="this.stop()":用来设置鼠标移入该区域时停止滚动</marquee>

这是一个完整的例子:

代码如下:
<marquee id="affiche" align="left" behavior="scroll" bgcolor="#FF0000" direction="up" height="300" width="200" hspace="50" vspace="20" loop="-1" scrollamount="10" scrolldelay="100" onMouseOut="this.start()" onMouseOver="this.stop()">
这是一个完整的例子
</marquee>

该标签支持的属性多达11个:

align
设定<marquee>标签内容的对齐方式
absbottom:绝对底部对齐(与g、p等字母的最下端对齐)
absmiddle:绝对中央对齐
baseline:底线对齐
bottom:底部对齐(默认)
left:左对齐
middle:中间对齐
right:右对齐
texttop:顶线对齐
top:顶部对齐

代码如下:
<marquee align="absbottom">align="absbottom":绝对底部对齐(与g、p等字母的最下端对齐)。 </marquee>
<marquee align="absmiddle">align="absmiddle": 绝对中央对齐。 </marquee>
<marquee align="baseline">align="baseline": 底线对齐。 </marquee>
<marquee align="bottom">align="bottom": 底部对齐(默认)。 </marquee>
<marquee align="left">align="left": 左对齐。 </marquee>
<marquee align="middle">align="middle": 中间对齐。 </marquee>
<marquee align="right">align="right": 右对齐。 </marquee>
<marquee align="texttop">align="texttop": 顶线对齐。 </marquee>
<marquee align="top">align="top": 顶部对齐。 </marquee>

behavior
设定滚动的方式:
alternate: 表示在两端之间来回滚动。
scroll: 表示由一端滚动到另一端,会重复。
slide: 表示由一端滚动到另一端,不会重复。
代码如下:
<marquee behavior="alternate">alternate:表示在两端之间来回滚动。 </marquee>
<marquee behavior="scroll">scroll:表示由一端滚动到另一端,会重复。</marquee>
<marquee behavior="slide">slide: 表示由一端滚动到另一端,不会重复。</marquee>

bgcolor
设定活动字幕的背景颜色,背景颜色可用RGB、16进制值的格式或颜色名称来设定。
代码如下:
<marquee bgcolor="#006699">设定活动字幕的背景颜色 bgcolor="#006699"</marquee>
<marquee bgcolor="RGB(10%,50%,100%,)">设定活动字幕的背景颜色 bgcolor="rgb(10%,50%,100%,)"</marquee>
<marquee bgcolor="red">设定活动字幕的背景颜色 bgcolor="red"</marquee>

direction
设定活动字幕的滚动方向
代码如下:
<marquee direction="down">设定活动字幕的滚动方向direction="down":向下</marquee>
<marquee direction="left">设定活动字幕的滚动方向direction="left":向左</marquee>
<marquee direction="right">设定活动字幕的滚动方向direction="right":向右</marquee>
<marquee direction="up">设定活动字幕的滚动方向direction="up":向上</marquee>

height
设定活动字幕的高度
代码如下:
<marquee height="500" direction="down" bgcolor="#CCCCCC">设定活动字幕的高度height="500"</marquee>

width
设定活动字幕的宽度
代码如下:
<marquee width="500" bgcolor="#CCCCCC">设定活动字幕的宽度width="500"</marquee>

hspace
设定活动字幕里所在的位置距离父容器水平边框的距离
This controls the horizontal(水平)space around the display box.
代码如下:
<table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><marquee hspace="100" bgcolor="#CCCCCC">hspace="100"</marquee></td>
</tr>
</table>

vspace
设定活动字幕里所在的位置距离父容器垂直边框的距离
This controls the vertical(垂直) space around the display box.
代码如下:
<marquee vspace="100" bgcolor="#CCCCCC">hspace="100"</marquee>

loop
设定滚动的次数,当loop=-1表示一直滚动下去,默认为-1
代码如下:
<marquee loop="-1" bgcolor="#CCCCCC">我会不停地走。</marquee>
<p> </p>
<marquee loop="2" bgcolor="#CCCCCC">我只走两次哦</marquee>

scrollamount
设定活动字幕的滚动速度,单位pixels
代码如下:
<marquee scrollamount="10" >scrollamount="10" </marquee>
<marquee scrollamount="20" >scrollamount="20" </marquee>
<marquee scrollamount="30" >scrollamount="30" </marquee>

scrolldelay
设定活动字幕滚动两次之间的延迟时间,单位millisecond(毫秒)
值大了会有一步一停顿的效果
代码如下:
<marquee scrolldelay="10" >scrolldelay="10" </marquee>
<marquee scrolldelay="100" > scrolldelay="100"</marquee>
<marquee scrolldelay="1000">scrolldelay="1000" </marquee>

原作者:不详
来 源:网络
共有735位读者阅读过

告诉好友

  • 上篇文章:已经没有了
  • 下篇文章JS实现无限级网页折叠菜单(类似树形菜单)效果代码
  • □- 本周热门文章 □- 相关文章
    1.喷射混合器[1242]
    2.制药设备GMP设计规范化要求[1092]
    3.关于特种设备行政许可有关事项的实施意见〔2019〕32号[981]
    4.常用工程塑料的代号、性能特点与应用表[914]
    5.SY/T 7085-2016 承压设备的设计计算[883]
    6.常用橡胶的品种 特性[861]
    7.公告 2012年 第18号 制药工业污染防治技术政策[705]
    GB/T 30354-2013 食用植物油散装运输规范
    NPT牙、PT牙、管螺纹的区别
    SolidWorks Toolbox设置中文技巧
    搜索引擎命令大全
    正常体温
    油罐车结构
    流程工厂P&ID设计的最佳实践 - PLANT3D快速上手教程
    资料主要来源于图书和网络,如有侵权请联系:5585196@qq.com 删除   压力容器设计参考  【苏ICP备2021048014号-1】