How can I implement automatic rotation (landscape mode) on mobile devices for my survey? | XM Community
Skip to main content

Hello,
We want mobile users to fill out the form in landscape mode. I found a code in the community questions (https://gist.github.com/marketinview/b605aeeb82d87ee76333) but in this solution, users need to rotate their phone to see the answers. However, what we are looking for is automatic rotation (such as in YouTube, you click in full screen and it rotates regardless of your screen options). I wonder what we can do to solve this problem. Thanks in advance!

gamzesener
Within Youtube as well you have to click on full screen and it is shown in landscape mode it doesn't happen without that click. An orientation lock can never happen as it disrupts the whole purpose of the screen. Hence, a trigger is needed to change the browser/Screen orientation.
In the link, you mentioned the trigger is rotating the mobile screen. You can make it a button as well.
The below link should help you configure this :
How to Change Screen Orientation with Javascript (usefulangle.com)
Hope it helps!


Leave a Reply