iOS 9 Safari: changing an element to fixed position while scrolling won't paint until scroll stops

后端 未结 5 1389
情深已故
情深已故 2020-12-02 08:09

I\'ve been developing a site and taking advantage from the rather good jQuery Sticky Kit plugin. It operates by switching the position property to fixed

5条回答
  •  悲&欢浪女
    2020-12-02 08:45

    I fixed this problem with an extra fixed element. After some testing I found out that it's the first element that becomes fixed has this problem. The 2nd, 3rd, etc works fine on iOS devices.

    So, put right after your body openingtag a div.fixed-fix:

    .fixed-fix {
        position:fixed;
        top:-1px; 
        height:1px; 
        width:100%; 
        background:white;
    }
    

    now it works! The fixed-fix div MUST have a backgroundcolor, because otherwise it wont work...

提交回复
热议问题