Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery Mobile, How to force orientation change, Programmatically [duplicate]

Throw JQuery Mobile is there are any way to show the Page in Landscape by code, I don't want to use orientationchange but I want to fire it Programmatically!

Any help,

like image 900
Bashar Abu Shamaa Avatar asked Nov 12 '22 22:11

Bashar Abu Shamaa


1 Answers

No, You can't do it

But, Try to add some layer over when user using mobile & portrait by using CSS

Something like...

HTML :

<div class="locked"></div>

CSS :

@media only screen
        and (min-device-width: 320px)
        and (max-device-width: 480px)
        and (orientation: portrait) 
{

    .locked {
        width:100%;
        height:100%;
        position:fixed;
        background:rgba(0,0,0,0.8);
        z-index:9999;
    }

}

So style this layer whatever you want, example some arrow or fake your website screenshot or fake css transform rotate, Just for let users change orientation :P

Demo : http://jsfiddle.net/cpJgT/show/ Try on your mobile

like image 179
l2aelba Avatar answered Jan 04 '23 02:01

l2aelba