欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
您的位置:DIVCSS5首页 > HTML >
  marquee元素可以实现简单的字体(图片等)的滑动等效果:
 
  <styletype="text/css">
 
  #div01{
 
  width:500px;
 
  }
 
  </style>
 
  <scripttype="text/javascript">
 
  </script>
 
  <marqueebehavior="alertnate"><fontsize=30color='red'>www.baidu.com111</font></marquee>
 
  <marqueedirection=rightbgcolor='#ff2233'behavior="alertnate"><fontsize=30color='blue'>www.baidu.com222</font></marquee>
 
  <marqueeid="m3"direction=downbgcolor='#dbdbdb'height=50pxhspace=20pxvspace=20pxbehavior="alertnate"scrollLeft=leftonmouseover="this.stop()"onmouseout="this.start()"><fontsize=30color='blue'>www.baidu333.com</font></marquee>
 
  <marqueeid="m4"direction=upbgcolor='#00dbdb'behavior="alertnate"><fontsize=30color='blue'>www.baidu444.com</font></marquee>
 
  <divid="div01"><marqueedirection=rightbgcolor='#ff2233'behavior="alertnate"scrolldelay=100><fontsize=30color='blue'>www.baidu.com555</font></marquee></div>
 
  <inputtype="button"onclick="m3.stop();"value="m3.stop"></input>
 
  <inputtype="button"onclick="m3.start();"value="m3.start"></input>
 
  <buttononclick="m4.stop();">m4.stop</button>
 
  <buttononclick="m4.start();">m4.start</button>
 
  direction表示滚动的方向,值可以是left,right,up,down,默认为left
 
  behavior表示滚动的方式,值可以是scroll(连续滚动)slide(滑动一次)alternate(来回滚动)
 
  loop表示循环的次数,值是正整数,默认为无限循环
 
  scrollamount表示运动速度,值是正整数,默认为6
 
  scrolldelay表示停顿时间,值是正整数,默认为0,单位似乎是毫秒
 
  align表示元素的垂直对齐方式,值可以是top,middle,bottom,默认为middle
 
  bgcolor表示运动区域的背景色,值是16进制的RGB颜色,默认为白色
 
  height、width表示运动区域的高度和宽度,值是正整数(单位是像素)或百分数,默认width=100%height为标签内元素的高度
 
  hspace、vspace表示元素到区域边界的水平距离和垂直距离,值是正整数,单位是像素。
 
  onmouseover=this.stop()onmouseout=this.start()表示当鼠标以上区域的时候滚动停止,当鼠标移开的时候又继续滚动。
 
  以下是设置点击按钮时m3、m4的滚动或停止:
 
  <inputtype="button"onclick="m3.stop();"value="m3.stop"></input>
 
  <inputtype="button"onclick="m3.start();"value="m3.start"></input>
 
  <buttononclick="m4.stop();">m4.stop</button>
 
  <buttononclick="m4.start();">m4.start</button>






本文转载自中文网
 

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h55282.shtml

如对文章有任何疑问请提交到DIV CSS论坛,或有任何网页制作CSS问题立即到CSS论坛发贴求解 或 直接DIVCSS5网页顶部搜索遇到DIVCSS疑问。
CSS教程文章修订日期:2018-08-14 17:37 原创:DIVCSS5
本文www.divcss5.com DIVCSS5版权所有。