How can I force WebKit to redraw/repaint to propagate style changes?

后端 未结 27 2365
我寻月下人不归
我寻月下人不归 2020-11-22 02:04

I have some trivial JavaScript to effect a style change:

sel = document.getElementById(\'my_id\');
sel.className = sel.className.replace(/item-[1-9]-selected         


        
27条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 02:40

    I am working on ionic html5 app, on few screens i have absolute positioned element, when scroll up or down in IOS devices (iPhone 4,5,6, 6+)i had repaint bug.

    Tried many solution none of them was working except this one solve my problem.

    I have use css class .fixRepaint on those absolute positions elements

    .fixRepaint{
        transform: translateZ(0);
    }
    

    This has fixed my problem, it may be help some one

提交回复
热议问题