Realization of news list based on JS Seamless scrolling up instance code _javascript tips

Source: Internet
Author: User

Using scrolling is a good choice when there's more news and a limited number of times, and this chapter explains how to do this with a code example.

The code example is as follows:

<! DOCTYPE html>  

The above code enables the News list scrolling effect, the following describes the implementation process:

I. Principle of realization:

The general principle is as follows, the demo element has two child elements demo1 and Demo2, and the content in the Demo1 in Demo2, the reason is to do so, in order to scroll up when the Demo2 can be connected to the back of the demo1, otherwise it will not be seamless scrolling, but the seam rolling, When the content of the demo1 is completely blocked, that is, demo1 completely rolling up, the Demo2 will happen to be in the Demo1 start scrolling position, and then reset the scrolltop value of the demo, so that scrolling back, so that the seamless scrolling effect.

Based on JS to achieve news list seamless upward scrolling instance code to introduce you here, I hope you can apply this code according to their actual needs.

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.