Ff&ie-compatible Scrolling code _ typical effects

Source: Internet
Author: User
<textarea id="runcode9792"><table width=250 border=0 bgcolor=f6f6f6 height= "" > <tr> <td height= "100px" > <div id= "sc Rollcont "onmouseover=" scrolling=1 "onmouseout=" scrolling=0 "> <div id=" scrollcont1 "> My Name is tomzhou! Hello,ipaddr HELLO,BCOMCN my Name is tomzhou2! HELLO,IPADDR2 hello,bcomcn2 </div> <div id= "Scrollcont2" ></div> </div> </td> </t R> </table> <script> var scrolling=0; var t=scrollcont.scrolltop; scrollcont2.innerhtml=scrollcont1.innerhtml; function Scrollshow () {if (scrolling==1) return; if (scrollcont2.offsettop-scrollcont.scrolltop<=0) scrollcont.scrolltop-=scrollcont1.offsetheight; else scrollcont.scrolltop++; } setinterval (scrollshow,50); </script></textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Where 100px is the height of the rolling area, the width is determined by the outer container of the Scrollcont, and the 50 inside the setinterval determines the speed of the scroll.

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.