marquee元素实现滚动字体图片滑动等效果
建站知识 2021-07-02 22:42www.168986.cn长沙网站建设
marquee元素可以实现简单的字体(图片等)的滑动等效果
<style type="text/css">
#div01{
width: 500px;
}
</style>
<script type="text/javascript">
</script>
<marquee behavior="alertnate"><font size=30 color='red'>.baidu.111</font></marquee>
<marquee direction=right bgcolor='#ff2233' behavior="alertnate"><font size=30 color='blue'>.baidu.222</font></marquee>
<marquee id="m3" direction=down bgcolor='#dbdbdb' height=50px hspace=20px vspace=20px behavior="alertnate" scrollLeft=left onmouseover="this.s()" onmouseout="this.start()"><font size=30 color='blue'>.baidu333.</font></marquee>
<marquee id="m4" direction=up bgcolor='#00dbdb' behavior="alertnate"><font size=30 color='blue'>.baidu444.</font></marquee>
<div id="div01"><marquee direction=right bgcolor='#ff2233' behavior="alertnate" scrolldelay=100><font size=30 color='blue'>.baidu.555</font></marquee></div>
<input type="button" onclick="m3.s();" value="m3.s"></input>
<input type="button" onclick="m3.start();" value="m3.start"></input>
<button onclick="m4.s();">m4.s</button>
<button onclick="m4.start();">m4.start</button>
direction 表示滚动的方向,值可以是left,right,up,down,默认为left
behavior 表示滚动的方式,值可以是scroll(连续滚动)slide(滑动一次)alternate(来回滚动)
loop 表示循环的次数,值是正整数,默认为无限循环
scrollamount 表示运动速度,值是正整数,默认为6
scrolldelay 表示停顿时间,值是正整数,默认为0,单位似乎是毫秒
align 表示元素的垂直对齐方式,值可以是,middle,bottom,默认为middle
bgcolor 表示运动区域的背景色,值是16进制的RGB颜色,默认为白色
height、width 表示运动区域的高度和宽度,值是正整数(单位是像素)或百分数,默认width=100% height为标签内元素的高度
hspace、vspace 表示元素到区域边界的水平距离和垂直距离,值是正整数,单位是像素。
onmouseover=this.s() onmouseout=this.start() 表示当鼠标以上区域的时候滚动停止,当鼠标移开的时候又继续滚动。
以下是设置点击按钮时m3、m4的滚动或停止
<input type="button" onclick="m3.s();" value="m3.s"></input>
<input type="button" onclick="m3.start();" value="m3.start"></input>
<button onclick="m4.s();">m4.s</button>
<button onclick="m4.start();">m4.start</button>
复制代码
代码如下:<style type="text/css">
#div01{
width: 500px;
}
</style>
<script type="text/javascript">
</script>
<marquee behavior="alertnate"><font size=30 color='red'>.baidu.111</font></marquee>
<marquee direction=right bgcolor='#ff2233' behavior="alertnate"><font size=30 color='blue'>.baidu.222</font></marquee>
<marquee id="m3" direction=down bgcolor='#dbdbdb' height=50px hspace=20px vspace=20px behavior="alertnate" scrollLeft=left onmouseover="this.s()" onmouseout="this.start()"><font size=30 color='blue'>.baidu333.</font></marquee>
<marquee id="m4" direction=up bgcolor='#00dbdb' behavior="alertnate"><font size=30 color='blue'>.baidu444.</font></marquee>
<div id="div01"><marquee direction=right bgcolor='#ff2233' behavior="alertnate" scrolldelay=100><font size=30 color='blue'>.baidu.555</font></marquee></div>
<input type="button" onclick="m3.s();" value="m3.s"></input>
<input type="button" onclick="m3.start();" value="m3.start"></input>
<button onclick="m4.s();">m4.s</button>
<button onclick="m4.start();">m4.start</button>
direction 表示滚动的方向,值可以是left,right,up,down,默认为left
behavior 表示滚动的方式,值可以是scroll(连续滚动)slide(滑动一次)alternate(来回滚动)
loop 表示循环的次数,值是正整数,默认为无限循环
scrollamount 表示运动速度,值是正整数,默认为6
scrolldelay 表示停顿时间,值是正整数,默认为0,单位似乎是毫秒
align 表示元素的垂直对齐方式,值可以是,middle,bottom,默认为middle
bgcolor 表示运动区域的背景色,值是16进制的RGB颜色,默认为白色
height、width 表示运动区域的高度和宽度,值是正整数(单位是像素)或百分数,默认width=100% height为标签内元素的高度
hspace、vspace 表示元素到区域边界的水平距离和垂直距离,值是正整数,单位是像素。
onmouseover=this.s() onmouseout=this.start() 表示当鼠标以上区域的时候滚动停止,当鼠标移开的时候又继续滚动。
以下是设置点击按钮时m3、m4的滚动或停止
复制代码
代码如下:<input type="button" onclick="m3.s();" value="m3.s"></input>
<input type="button" onclick="m3.start();" value="m3.start"></input>
<button onclick="m4.s();">m4.s</button>
<button onclick="m4.start();">m4.start</button>
长沙网站设计
- 如何进行东阳SEO关键词优化?
- 边坝哪有关键词排名优化:提升你的网站流量与
- 安国百度优化服务:提升您的在线可见性
- 阜康新手做SEO怎么做
- 山西seo网站排名关键词优化:提升您网站曝光率
- 临沂seo网站排名关键词优化:提高你的网站可见
- 广西SEO网站推广怎样付费比较合理
- 双辽SEO网站推广:提升你的网站可见性与流量
- 辽宁企业网站优化购买方式有哪些
- 提升宝清百度SEO排名的实用技巧与策略
- 静宁百度SEO排名:提升您网站曝光率的关键策略
- 彭州百度SEO排名的提升策略和实施指南
- 广南百度关键词SEO:提升网站排名的关键策略
- 辽宁关键词优化怎么做论坛营销
- 吉林百度seo排名如何做到让用户满意
- 内黄百度优化服务:提升在线可见性的关键