Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
kbhaggan
Posts: 6
Registered: ‎02-27-2013
My Device: Bold 9930
My Carrier: T-Mobile

Scroll Issue in div with dynamic content

Hi,

 

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.

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: Scroll Issue in div with dynamic content

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-scrolling-hardware-acceleration/

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
New Contributor
kbhaggan
Posts: 6
Registered: ‎02-27-2013
My Device: Bold 9930
My Carrier: T-Mobile

Re: Scroll Issue in div with dynamic content

Hi,

 

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.

 

 

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: Scroll Issue in div with dynamic content

Are you using a framework like bbUI?

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
New Contributor
kbhaggan
Posts: 6
Registered: ‎02-27-2013
My Device: Bold 9930
My Carrier: T-Mobile

Re: Scroll Issue in div with dynamic content

I am using jQeury Mobilr
Please use plain text.
New Contributor
kbhaggan
Posts: 6
Registered: ‎02-27-2013
My Device: Bold 9930
My Carrier: T-Mobile

Re: Scroll Issue in div with dynamic content

Hello,

 

Is there any way to work around this?

Please use plain text.
Developer
interfaSys
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Scroll Issue in div with dynamic content

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.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Please use plain text.