JQuery Mobile Fixed Toolbar and Footer Bar disappears?

前端 未结 14 1144
Happy的楠姐
Happy的楠姐 2020-12-07 10:11

I am using JQuery Mobile version 4.1a and using:

data-position=\"fixed\"

on both header and footer.

When I scroll the content it di

14条回答
  •  鱼传尺愫
    2020-12-07 10:26

    I was having the same issue, I was able to fix it by adding the following transform code to the fixed position element, (transform: translateZ(0);-webkit-transform: translateZ(0);) that forces the browser to use hardware acceleration to access the device’s graphical processing unit (GPU) to make pixels fly. Web applications, on the other hand, run in the context of the browser, which lets the software do most (if not all) of the rendering, resulting in less horsepower for transitions. But the Web has been catching up, and most browser vendors now provide graphical hardware acceleration by means of particular CSS rules.

    Using -webkit-transform: translate3d(0,0,0); will kick the GPU into action for the CSS transitions, making them smoother (higher FPS).

    Note: translate3d(0,0,0) does nothing in terms of what you see. it moves the object by 0px in x,y and z axis. It's only a technique to force the hardware acceleration.

    #element {
        position: fixed;
        ...
        /* MAGIC HAPPENS HERE */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    

提交回复
热议问题