Home > Web Front-end > JS Tutorial > js+div实现图片滚动效果代码_javascript技巧

js+div实现图片滚动效果代码_javascript技巧

WBOY
Release: 2016-05-16 17:01:00
Original
1115 people have browsed it

横向

onmouseout="doscroll()">




<script> <BR>var t=demo.scrollWidth <BR>demo1.innerHTML+=demo1.innerHTML <BR>function doMarquee() <BR>{ <BR>demo.scrollLeft=demo.scrollLeft<demo.scrollWidth-demo.offsetWidth?demo.scrollLeft+1:t-demo.offsetWidth <BR>} <BR>function doscroll() <BR>{ <BR> sc=setInterval(doMarquee,20) <BR>} <BR>function stopscroll() <BR>{ <BR> clearInterval(sc) <BR>} <BR>doscroll() <BR></script>


纵向




<script> <BR>var speed=100 <BR>demo2.innerHTML=demo1.innerHTML <BR>function Marquees(){ <BR>if(demo2.offsetTop-demo.scrollTop<=0) <BR>demo.scrollTop-=demo1.offsetHeight <BR>else{ <BR>demo.scrollTop++ <BR>} <BR>} <BR>var MyMars=setInterval(Marquees,speed) <BR>demo.onmouseover=function() { clearInterval(MyMars) } <BR>demo.onmouseout=function() { MyMars=setInterval(Marquees,speed) } <BR>zlselect('6'); <BR></script>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template