Other parts of the JS performance scroll bar

Source: Internet
Author: User

Problem:

If a page has a large aspect ratio, that is, the page needs a scroll bar to view the contents of the other pages, the rest of the scroll bar is still in the running state.

For example, that part of the video playback, but those videos are not visible in the current window, but they will still be in the playback state, that is, in the constant consumption of resources on the page!

Workaround:

# If the page does not have scroll bars, that is, a page can fully display all the content, there is no need to solve the problem.

1 Write a function, specifically for listening to all the content of the page, if a module is outside the scroll bar, the module is hidden operation--display:none;

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.