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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 10
Registered: ‎10-07-2010
My Device: Not Specified

Re: preventing zoom on double tap <meta name="touch-event-mode" content="native"/> not working :/

Hi,

     i has been the same problem and i solved very easy with hammer.js (javascript library for multi-touch gestures)  download from eightmedia.github.io/hammer.js/

 This is my code, work great, and easy in 2 steps

1- add the hammer library <script src="js/hammer.js" type="application/javascript"></script>

 

2- add the magic script 


window.addEventListener('load', function() {
var element = document.getElementById('canvas');
var hammertime = Hammer(element).on("doubletap", function(event) {
event.gesture.preventDefault();
})

}, false);

 

If you've been helped click on Like Button

 

New Contributor
Posts: 8
Registered: ‎11-05-2013
My Device: z10
My Carrier: telcel

Re: preventing zoom on double tap <meta name="touch-event-mode" content="native"/> not working :/

ill give it a try!, it scrolls when I slide my finger across the screen, can this be fixed too?
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: preventing zoom on double tap <meta name="touch-event-mode" content="native"/> not working :/

Sure thing, fire it along to eoros@blackberry.com


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.
Contributor
Posts: 10
Registered: ‎10-07-2010
My Device: Not Specified

Re: preventing zoom on double tap <meta name="touch-event-mode" content="native"/> not working :/

for scroll problem try this script, work fine form me 

 

document.addEventListener('touchmove', function(e)
{
e.preventDefault();
window.scroll(0,0);
return false;
}, false);

 

and for prevent zoom with open two fingers on screen change window.scroll for window.zoom

 

If you've been helped click on Like Button

Highlighted
New Contributor
Posts: 8
Registered: ‎11-05-2013
My Device: z10
My Carrier: telcel

Re: preventing zoom on double tap <meta name="touch-event-mode" content="native"/> not working :/

hi there guys, i have solved the problem with your help, to prevent screen scrolling i used this:

 

document.addEventListener('touchmove', function(e)
{
e.preventDefault();
window.scroll(0,0);
return false;
}, false);

 

and for preventing the double  tap zoom, i used a meta viewport var, my entire script is this:

 

 

 <script>
             var meta = document.createElement("meta");
             meta.setAttribute('name', 'viewport');
             meta.setAttribute('content', 'initial-scale=' + (1 / window.devicePixelRatio) + ',user-scalable=no' + ',');
             document.getElementsByTagName('head')[0].appendChild(meta);

             document.addEventListener('touchmove', function (e) {
                 e.preventDefault();
                 window.scroll(0, 0);
                 return false;
             }, false);
        </script>

 

 TNKS  zayrus and oros