About jquery implementation scrolling to the bottom of the automatic loading should be noted in the place

Source: Internet
Author: User

Automatic loading at the bottom of the scroll is often used to the following code

function () {    if(container.scrolltop () + container.height () >= container.prop ("ScrollHeight")) {           loadnextpage ();    }});

where Container.prop ("ScrollHeight") is equivalent to Container.get (0). ScrollHeight is used to get the true height of the container, this true height includes the part that is rolled up by the scroll bar

However, it should be noted that if the container is not displayed (such as being designed into a tab, Display=none), then ScrollHeight is not able to get the height of container!

Similarly, the value obtained using the Getboundingclientrect method is also 0.

That is, getboundingclientrect and scrollheight can only be used in the case of element display , which should be noted in the scrolling load under Design tab and in the search for modules such as auto-complete dropdown boxes.

About jquery implementation scrolling to the bottom of the automatic loading should be noted in the place

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.