0
I wonder how I can block my site when viewed horizontally by mobile, when it can only be handled vertically.
It can be in Javascript or PHP however, this should only happen with mobile device.
OBS.: When I say block, I mean I will increment the script to appear a message that informs that the horizontal use is disabled.
Are you developing a mobile webapp? If not, impossible, because a common site does not have access to user settings, and there is no way you can set this, since your site is not installed on the user’s device. Search for identify Portrait and Landscape mode via browser.
– user28595
There’s no way you can be sure if it’s a mobile device or not. Web technologies (mainly CSS and HTML) are fundamentally broken (usually made by committees of theorists who do not use it on a daily basis). So much so that they didn’t hit fundamental things, such as knowing the DPI of the screen, real amount of pixels, orientation of individual elements (evil and evil you can use @media + orientation, and it’s not 100% reliable). Unfortunately, you can’t innovate much for the web without restricting the public. Either make it simple for everyone, or make it complicated and only for those who have new machine and browser.
– Bacco
An alternative is to make it responsive, see an example of responsive website that works well on qq device: http://motherfuckingwebsite.com/
– Bacco