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
Posts: 15
Registered: ‎11-11-2012
My Device: Blackberry 10 Dev Alpha B
My Carrier: Tigo - Colombia

How to setup the viewport in a BB10 themed JQM App?

Hello guys

 

I wanted to give Webworks a try (After a nightmare debugging C++ code. It'd be really nice if a managed language is added, preferrably C#/Mono) and after being punched in the face (the frustration levels were high with this one) by bbUI.js, i decided to give JQuery Mobile a try (I am certainly loving it's clean and well thought workflow) with the BB10 theme so i could still achieve a native look, yet im being frustrated that i can pinch zoom in my app normally (this should NOT happen) and adding the meta tag sugested by bbUI.js makes my app look like zoomed-in already to the max and looks pretty ugly. (Event hough i cant zoom in or out, hneither scroll, which is the intended behaviour)

 

Any thoughts?

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: How to setup the viewport in a BB10 themed JQM App?

[ Edited ]

Just check below code works or not. 

 

<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);
</script>

 

Also read the content in this link: 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/KB-How-to-set-up-the-viewport-fo...

Contributor
Posts: 15
Registered: ‎11-11-2012
My Device: Blackberry 10 Dev Alpha B
My Carrier: Tigo - Colombia

Re: How to setup the viewport in a BB10 themed JQM App?

It doesnt work, i can still scroll and zoom around.