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

Posts: 1
Registered: ‎03-09-2010
My Device: Blackberry Storm
My Carrier: Web Developer

Stop resizing when turning the device?



Im designing a mobile website and trying to stop Blackberry resizing the page view when turning the device by 90°.


I already tried using both meta-tags, supported by the Blackberry Internet Browser:


<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0" />
<meta name="HandheldFriendly" content="true" />


The page itself displays correctly. - But when I turn the device, the browser still resizes the page. (Turning the device from 360x480 to 480x360 zooms the page view, on the other side 480x360 to 360x480 minifies the view.)


Since i am designing a mobile site I don't need this behaviour. On the contrary,it rather confuses the visitor. Is there any way to deactivate this zooming behaviour?


Sincere regards,

Christian Eßl

Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Stop resizing when turning the device?

What is happening when the device rotates is that it is changing the scale of the page to re-render it quickly.  You can trap the onorientationchange and re-adjust your content's size to see if that gives you the desired result.



window.onorientationchange = function() {
	document.getElementById("mainBody").style.height = screen.height+"px";	



Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter