The problem of fixed element jitter on the mobile side

Source: Internet
Author: User

Work found that to add a fixed property to an element, so that it fixed in a window, the direct addition of fposition:fixed properties can achieve this effect;

The effect on the Android phone is better, but the iOS system's individual browser compatibility is not good, such as QQ browser, UC Browser, 360 browser (these are the most vulnerable browsers iOS);

Problem: When the user quickly swipe the page, the fixed element will bounce or jitter in the window, which greatly affects the user experience

The following provides a few solutions, for reference only, if there is a better and more effective solution, welcome message exchange Discussion!

Method One:

Set height to Body 100%

body,html{    widht:100%;    height:100%;}

This method works well, but it works on pages that you develop separately.

If the page is already in the project and there are other effects, setting this property directly may affect other features of the page.

If you use this method, the local debugging effect is not good, it is recommended not to use.

Method Two:

Add a background positioning property to a fixed element

background-attachment:fixed;

Avoid: This attribute does not add to the element with background picture

This method seems to be effective, because there is no test machine restrictions, can not test the effect, a qualified friend to try;

Here are the other methods found on the network, I tried not to work, listed for everyone to refer to

Method Three:

Add the Transform property to fixed positioned elements

Transform:translatez (0); Transform:Translate3d (0,0,0);

The result of my attempt is that this method has no effect;

Method Four:

Add a layer of box, the outer fixed positioning, the inner layer of the set absolute positioning absolute;

There is also a way to say that the absolute positioning can be simulated fixed positioning, I do not have a simulation, the method provided on the Internet has not achieved this effect.

The problem of fixed element jitter on the mobile side

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.