This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Ken Yiu
Posted Aug 31 - Read on Facebook

Is there any native way to lock the orientation?

8 Comments

Joshua Tucker

There is a Screen Orientation API, but unfortunately it doesn't look like it's currently well-supported across browsers. Maybe this will point you in the direction of a solution.

http://www.sitepoint.com/introducing-screen-orientation-api/

Mozilla's docs for a method specifically called Screen.lockOrientation() is listed here, but again, not well supported.

https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation#Browser_compatibility

Ken Yiu

Thanks Joshua Tucker.Seems hard to create portrait-only prototype

Jordan Robert Dobson

You could always use one of the framer apps? Frameless is one but doesn't have that feature. Or wrap it in a phoneGap app. One trick is also to detect rotation and just present a "portrait mode only" message... Its just a prototype so I'm not sure why you'd need that hard restriction.

Ken Yiu

You're right. i need a wrapper to lock the viewport

Jordan Robert Dobson

Add this to your home screen... http://mrgan.com/pieguy/ see what he did to exclude portrait.

I worked on some orientation code with Joshua recently that would likely help. :)

Ken Yiu

Cool. Let me try

Adam Mazurick

Hi Ken Yiu did you ever figure out a way to do this?

Ken Yiu

Not yet, have u got any clue?

Read the entire post on Facebook