Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

As the title is it possible to emulate orientation in google chrome or firefox? Meaning somehow change the browser to support media query (orientation = (landscape or portrait))

I have a emulator for mobile, but I would like to have the developer tools from chrome or firebug.

Update

Chrome v25 specific...

To anyone, in Google Chrome Dev Tool > Overrides > Override Device Orientation you can change the alpha, beta and gamma. I think this is a place to start of from, but I have no idea how these work and can therefor not find anything..

It is also possible to Emulate CSS Media, but not portrait and landscape, but print, screen, tv etc.

Update v2

This is a old question, and Chrome have changed multiple times how to do this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
696 views
Welcome To Ask or Share your Answers For Others

1 Answer

In Chrome Dev Tools: If you go to Settings>Overrides>Device metrics

If you swap the dimensions for the screen resolution the orientation will change and the orientationchange-event will be triggered.

The orientation is depending on the relationship between 'width' and 'height'. If 'height' has a higher value than 'width', the browser will be in orientation: 'portrait' and vice versa.

height > width = portrait
height < width = landscape


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...