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
jermaine150
Posts: 17
Registered: ‎01-06-2011

Hide Action Menu When Scrolling Page

 

 

I'm on webworks for BB10 and wanted to know it it's possible to hide the action menu when scrolling up and show it again when scrolling down.

Does someone have a sample of this?

 

I know it's possible with cascades, according to this thread: http://supportforums.blackberry.com/t5/Native-Development/Hide-Action-Menu-When-Scrolling-Page/td-p/...

 

But can this be done on Webworks?

Please use plain text.
Administrator
astanley
Posts: 1,359
Registered: ‎07-02-2009
My Carrier: Bell

Re: Hide Action Menu When Scrolling Page

In web, devs typically use a UI library like bbUI.js to provide these features.

 

Here are the docs for Action Bars in bbUI:

https://github.com/blackberry/bbUI.js/wiki/Action-Bar

 

I see there are show() and hide() functions available.  You might be able to detect the start of a scroll and call hide(), then call show() when the scroll is finished.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Contributor
jermaine150
Posts: 17
Registered: ‎01-06-2011

Re: Hide Action Menu When Scrolling Page

 

Thanks for pointing me in that direction. I'm starting a new app and im in doubt whether to use BB-jQueryMobile Theme or use bbUI.js, this might help make the choice easier. :-)

 

Is this also possible with BB-jQueryMobile? I couldn't find clear documentation on it like BBUI.js has.

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,465
Registered: ‎04-12-2010
My Carrier: Bell

Re: Hide Action Menu When Scrolling Page

Just one note to be careful with how much processing you are doing "onscroll". If you have a lot in there, you'll likely see a performance degradation.

I would recommend calling hide() every time on scroll and use a flag to indicate whether it's already hidden; and only hide it if not. It will be much less costly to do a comparison against a boolean value and exit the function, than re-hide an already hidden element.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.