最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Fixed position delayed on IOS - Stack Overflow

programmeradmin8浏览0评论

After I tested affix on my website on iPad I find out that it is not working properly and I goggled that it is problem with iOS and currently there is no easy solution for that.

iOS just has problems with calculating fixed position as you scroll. Basically you don't get an updated fixed position until a slight delay after you stop scrolling

Is there anything I can do to make it work, may be some one already done some work around?

After I tested affix on my website on iPad I find out that it is not working properly and I goggled that it is problem with iOS https://github./twbs/bootstrap/issues/11560 and currently there is no easy solution for that.

iOS just has problems with calculating fixed position as you scroll. Basically you don't get an updated fixed position until a slight delay after you stop scrolling

Is there anything I can do to make it work, may be some one already done some work around?

Share Improve this question edited Dec 22, 2014 at 7:28 Sergino asked Dec 25, 2013 at 11:48 SerginoSergino 10.8k37 gold badges107 silver badges181 bronze badges 3
  • If you read the entire thread there's no answer to make it work. – Christina Commented Dec 25, 2013 at 17:32
  • yes I did, but just wondering may be some one outside that thread, here on SO, have any opinions on that. – Sergino Commented Dec 25, 2013 at 22:35
  • Change the title to "fixed position delayed on IOS" or something. If you read that thread you'll see that @fat (the programmer for Bootstrap's scripts) and the person behind WayPoints (one of the most popular affix scripts) have found no solutions because it's an IOS native behavior. You'll notice that if the section is position:fixed on load, that this doesn't happen but if the affix is triggered by a user action (scroll) the delay happens. – Christina Commented Dec 26, 2013 at 1:54
Add a ment  | 

1 Answer 1

Reset to default 9

This, sometimes, made the trick for me.

    .youraffixelement {
       -webkit-transform: translate3d(0, 0, 0);
       transform: translate3d(0, 0, 0);
    }

It enables hardware acceleration on iOs devices, and the scroll position is calculated faster.

发布评论

评论列表(0)

  1. 暂无评论