html - Disable landscape orientation for mobile users in responsive website -
I have a website which is responsive (there is a separate media query for mobile). This picture looks good on orientation, but there is a mess on the scenario, so we want to disable landscape orientation for mobile devices (at least Android and iOS at least) before fixing it. I tried to do this with the vieport meta tag, but it does not do too much, shows me the correct zoom and does not allow the user to scale, but still allows to change the orientation.
& lt; Meta name = "viewport" content = "width = device-width, initial-level = 1.0, maximum-scale = 1.0, user-scalable =" not "& gt;
How can I get such effects?
Only fine I window.orientation
< According to code> $ (window) .bind ("orientationchange", function (), I am ready to rotate my body or cover, {var orientation = window.orientation; var new_orientation = (Orientation)? 0: 180+ orientation; $ ('Body'). CSS ({"-webkit-transform": "Rotate (" + new_orientation + "deg)"});});
This is a risky way but its only way.
Optional You can bind to a window resize event.
$ (window) .bind ("resize", function ()
Comments
Post a Comment