disable mobile rotation / show notification when phone is landscape
-
Hi
Is there a way to stop mobile rotation / lock screen?
Cheers
Toby -
no there isn't :/
-
It would be great if this feature could be added.
-
there is no way to do this!
you can probably show a warning using custom css & custom html that shows up when the phone is in landscape mode using a combination of media queries and html classes
and
body.is-touchdevice
body has a class of "is-touchdevice" when ure on a phone
-
ok heres an example:
custom html at bottom:
<div class="rotate-notification"> <div class="rotate-text _Default_no_spaces">Please rotate your phone</div> </div>
custom css:
.rotate-notification{ display:none; z-index: 999999; background-color: black; width: 100%; height: 100vh; position: fixed; top: 0; left: 0; } .rotate-text{ position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white!important; } @media (orientation: landscape) and (max-width: 1024px){ body.is-touchdevice .rotate-notification{ display: block; } }
haven't tested it :D
-
instead of doing this you could also do:
in
lay options → Phone Breakpointyou can set this to a higher value, so the phone version would still show up on landscape mode, instead of the desktop version
maybe that looks good enough then
-
Or if you want an image:
<div class="rotate-notification"> <img src="https://media.istockphoto.com/id/1144546554/vector/rotating-phone-from-vertical-to-horizontal-position-phone-vector-icon.jpg?s=612x612&w=0&k=20&c=dnBtqmZ7_8Cjk2UubtE_o1gDkaIMvs1kStk45tzmEiY="> </div>
css:
.rotate-notification{ display:none; z-index: 999999; background-color: black; width: 100%; height: 100vh; position: fixed; top: 0; left: 0; } .rotate-notification img{ position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 150px; } @media (orientation: landscape) and (max-width: 1024px){ body.is-touchdevice .rotate-notification{ display: block; } }
I don't answer or check forum DMs, please just post on the forum.
Before you post:
Use the Search Feature. Maybe there is already a solution to your issue.
1. Update Lay Theme and all Lay Theme Addons
2. Disable all Plugins
3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
4. Now see if your problem solved itself
5. Go here, see if your problem is listed here:
Troubleshooting
When you post:
1. Post a link to where the problem is
2. If the problem is difficult to explain, post screenshots / link to a video to explain it