Is It Possible To Use Javascript/CSS To Swap Style Sheets When A Mobile Device Rotates?

Posted by Sean M on Stack Overflow See other posts from Stack Overflow or by Sean M
Published on 2010-03-21T05:10:04Z Indexed on 2010/03/21 5:11 UTC
Read the original article Hit count: 395

Filed under:
|
|
|
|

I am working on a site that must be designed with mobile accessibility in mind. As part of our brainstorming, we wondered whether it's possible to detect, for a mobile browser (i.e. Mobile Safari or the Android browser), when the viewing device has changed orientation, and to use that as a trigger to change page content? As the title of this question implies, our best-case scenario is the ability to detect the orientation change and use it to alter the CSS on the fly so as to present a slightly different page for landscape versus portrait.

Of course we can just design for a page that looks good one way and make it obvious that it's supposed to be viewed that way, but the cool-stuff factor of a page that looks good either way is pretty appealing.

Is this idea implementable? Practical?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about android