Intermittent, seamless scrolling effect (the effect of recording with GIF is not very good, interested can down code), the specific contents are as follows
Code:
Note the point:
1. Box block to CSS overflow hidden: overflow:hidden
2. Two features: intermittent scrolling/seamless scrolling
3. First copy a piece of the same code, seamless scrolling: The execution timer has been increased scrolltop value, when the scrolltop value is greater than the box height, set the scrolltop to 0, to start over. Intermittent scrolling on this basis adds a settimeout, intermittent execution, which reaches the specified height stop at scrolltop
4. Question: SetInterval in code (function () {scrolling ()},30); This can be done, setinterval (' Scrolling () ', 30); So no, there is no great God under the guidance of the two, what is the difference? What's the mechanism?
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.