02-27-2013 02:56 AM
I am working on a blackberry webworks app in which I use a div (with ul). The code somewhat seems like:
<div style='height: 300px;overflow-y:auto;'><ul><li></li</ul</div>
This list is populated dynamically with an ajax call. The problem is that if the div is populated dynamically, scrolling does not work smooth. But if I manually change the html with some dozen items (hard coded) then scrolling works smoothly.
Any help would be appreciated.
02-27-2013 10:00 AM
We have a blog post about how to get the best scrolling performance in your app, it's available here: http://devblog.blackberry.com/2013/01/overflow-scr
02-27-2013 01:42 PM
I already use the -webkit-overflow-scrolling:touch;.
But now I guess my question is not clear. I meant that scrolling works to some extent after the div has been updated with the contents and scrolling does not work. But when I manually create the div with the html content in it, it works perfect, but when I dynamically add items to the div, scrolling works to some extent.
03-04-2013 06:00 AM
A couple of things I've noticed:
- HW acceleration doesn't kick in if you still have content loading, so try to wait a bit and see if scrolling is smooth after that. If it is, you may want to block user interaction until everything has been loaded.
- Animated gifs kill HW acceleration, so block those animations if you have some in your content.