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
New Contributor
Posts: 3
Registered: ‎05-05-2013
My Device: Q10
My Carrier: Viettel
Accepted Solution

Get touch event on BB10 simulator

Im studying BB10 Webworks. For exl I have this : 

 

<div id="main">
<div class="field"></div>
<div class="field"></div>
<div class="field"></div>
<div class="field"></div>
<div class="field"></div>
<div class="field"></div>
<div class="field"></div>
<div class="field"></div>
<div class="field"></div>
</div>

 

How do I get the event when I touch a div ? It's ok when work with web by onclick but with simulator, I dont know how to get touch event. Can someone help me out, tks so much Smiley Happy

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

Re: Get touch event on BB10 simulator

Here is a sample page that can be used to understand how touch events work:

 

http://blackberry.github.io/WebWorks-Samples/kitchenSink/html/browser/touch.html

 

On the BlackBerry 10 simulator, you should expect to see the TouchStart, TouchMove and TouchEnd events firing when you interact with page content using the mouse (note: the click events will also fire).  Make sure you are listening for and handling the touch events correctly.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Get touch event on BB10 simulator

I've accepted astanley's response as the solution to this as it outlines the various touch events and a sample for integration. If you have any further questions, don't hesitate to respond.


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.