如何在HTML中实现图片的滚动效果

<MARQUEE onmouseover=stop() onmouseout=start() scrollAmount=3 loop=infinite deplay="0"><IMG src="http://www.likecs.com/第一张图片地址" ><IMG src="http://www.likecs.com/第二张图片地址"></MARQUEE>
注释:
1) scrollAmount。它表示速度,值越大速度越快。
2) 加入onmouseover=stop() onmouseout=start()代码,鼠标指向循环文字图片时他们会停止滚动,鼠标离开时继续滚动。
给滚动图片加超链接
用<a href=http://www.likecs.com/>和</a>把<img>包围,并且img必须设border=0,否则图片会出现边框。例子如下:
<MARQUEE scrollAmount=3 loop=infinite deplay="0"><a href="http://www.likecs.com/链接网址"><img src="http://www.likecs.com/图片网址" border=0></a></MARQUEE>
图片从右到左滚动
<MARQUEE width=宽 height=高 onmouseover=stop() onmouseout=start() scrollAmount=速度 loop=infinite deplay="0"><img src="图片地址 "><img src="图片地址 ">···</MARQUEE>
图片从下到上滚动
<marquee behavior="scroll" direction=up scrollamount="5"><img src="图片网址 "><img src="图片网址 ">···</marquee>
带有超链接的图片实现滚动效果
<marquee behavior="scroll" direction=up scrollamount="1" scrolldelay="60"><a target="cont" href="http://www.likecs.com/连接地址"><img src="http://图片地址" idth="88"></a><a target="cont" href="http://www.likecs.com/连接地址"><img src="http://www.likecs.com/图片地址"></a></marquee>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zgydwj.html