Simple seamless scrolling program-only a few lines of code _javascript tips

Source: Internet
Author: User
<ul id= "Scrollbox" style= "width:300px;height:80px;overflow:hidden;margin:0;padding:0;line-height:20px; font-size:12px; " >
<li>1. Have you ever had many dreams,</li>
<li>2. But in the passage of time disillusionment </li>
<li>3. Have you ever looked forward to the future,</li>
<li>4. But lost in the years of growth </li>
<LI>5.CSDN China Programmers Forum </li>
<li>6, let's all go </li>
<li>7. Looks like it's all good. </li>
</ul>
<script type= "Text/javascript" >
var t=setinterval (myfunc,1000);
var Obox=document.getelementbyid ("Scrollbox");
function MyFunc () {
var o=obox.firstchild
Obox.removechild (o)
Obox.appendchild (o)
}
Obox.onmouseover=function () {clearinterval (t)}
Obox.onmouseout=function () {T=setinterval (myfunc,1000)}
</script>

Dom method of Getelementsbyclassname

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.