CSS3 property webkit-overflow-scrolling:touch ERROR

前端 未结 8 1452
闹比i
闹比i 2020-11-28 01:35

iOS 5 released web designers a new property -webkit-overflow-scrolling:touch that uses the iOS devices hardware accelerator to provide native scrolling for a sc

8条回答
  •  天涯浪人
    2020-11-28 01:59

    As @relluf pointed out, applying 3D transitions on the relative element fixes the bug. However, I investigated it a bit further and it seems that applying -webkit-transform: translateZ(0px) works too (this is what Google does on gmaps map container) and it does not need to be on the relatively positioned element, just the direct descendant of the scrollable element.

    So if you don't want to manually keep a list of all the places where the fix is needed, you just might do:

    element {
        -webkit-overflow-scrolling: touch;
    }
    
    element > * {
        -webkit-transform: translateZ(0px);
    }
    

提交回复
热议问题