Element dislocation solution and dislocation solution during html page scrolling

Source: Internet
Author: User

Element dislocation solution and dislocation solution during html page scrolling

A page with a complex layout. When running on a mobile browser, some mobile phones with poor configuration will scroll the scroll bar, and the page will scroll normally, but some elements appear similar to position: fixed is usually suspended on the page and then rolled. It looks a little like parallax scrolling, but it is not easy to see at all.

Solution: add the style: transform: translateZ (0);-webkite-transform: translateZ (0) to the slider ).

<Div style = "height: 300px; overflow: auto"> <div style = "transform: translateZ (0);-webkite-transform: translateZ (0 ); "> various complex html <div> </div>

The goal is to use GPU acceleration (GPU cache ).

Because of this problem, if you use overflow: auto to slide the page (in the form of html scroll bars), the browser will frequently have scroll, update layer tree, and composite layers each time the page slides. It should be due to a problem in the last step. This problem should be caused by layout.

Related Article

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.