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
Highlighted
Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone
Accepted Solution

Space to Scroll

Is it possible to implement a feature that scrolls the page when a user hits the scrollbar?
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Space to Scroll

why not?
just trap the key press event, and if the key is space call a javascript function to do your scrolling
Nuno
Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Space to Scroll

Would you happen to have a sample code? Trapping the spacebar is fine, its the scrolling part that's the issue
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Space to Scroll

Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Space to Scroll

I tried a lot of samples, most of them either scroll to the bottom or to an anchor. I wanted a js that simple scrolls say 50px.
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Space to Scroll

that's exactly what scrollTo does.

don't be lazy, there are plenty of samples Smiley Happy

Nuno
Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Space to Scroll

Haha no let me explain, my app has a lot of dynamic content loading through xhr, even if I added an anchor to the divs, it would merely scroll maybe 20px, plus each anchor name would need to be programatically made unique
Developer
Posts: 289
Registered: ‎10-17-2008
My Device: Torch 9800
My Carrier: Rogers

Re: Space to Scroll

http://www.w3schools.com/jsref/met_win_scrollby.asp

feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Space to Scroll

Thanks man, I really appreciate that, will give it a shot.
Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Space to Scroll

Tried this, assumed it would be smooth scrolling. Any solution to make it scroll smoothly without jquery being involved?