Home >Web Front-end >JS Tutorial >FF&IE compatible scrolling code_Typical special effects

FF&IE compatible scrolling code_Typical special effects

WBOY
WBOYOriginal
2016-05-16 19:20:481341browse

[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]

Among them, 100px is the scroll area The height and width are determined by the outer container of scrollcont, and the 50 in setInterval determines the scrolling speed. <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>
Statement:
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