开发者

How to fix slow scrolling when using webkit-transform and relative positioning on the iphone

I have implemented scrolling of a div by using relative positioning and webkit animation for the iphone, it works beautifully on desktop safari but is choppy on the actual iphone (fine on the simulator).

The scrolling works by having a div nes开发者_如何学Pythonted and clipped (overflow:hidden) by its parent. I then set the top position and animate it with -webkit style declarations. The iphone seems to noticeably slow down when there are a lot of items in the inner div.

Any ideas how make the scrolling smoother?

This was a problem with iScroll code and my own hand coded stuff.


Using translate3d is much faster than straight up translate, as it utilizes hardware acceleration.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜