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
Contributor
Wongadob
Posts: 40
Registered: ‎05-12-2012
My Device: 9800

Detecting scroll speed in Webworks

Hi,

 

I am working on a project where I have a number of messages on screen. Each message has a number of highlightable areas to it such as name, group etc. When using focused based navigation I have move up and down throuh all elements of the message, onto next message etc etc.

 

But what I now need to do is detect if the user is scrolling fast and if so move down an message at a time rather than an item at a time.

 

How can i detect the speed of the scroll wheel. is there an api call. I have trawled the docs and I can't find anything.

 

AHMA (any help much appreciated) 

Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Detecting scroll speed in Webworks

No I'm not aware of an API to measure scrolling speed.

 

I haven't done this myself, but I would guess you could create your own solution. You may be able to do the following?

 

1) Assign an event listener to each relevant content element displayed on the page.

2) Make this listener watch for when the content becomes visible?

3) Measure the interval of time between these events.

4) Calculate how fast the page is being scrolled based on these measurements?

 

No guarantees on this - not sure whether this proposed solution would impact performance.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.