Posted By

iridium on 12/15/11


css class body iphone portrait landscape orientation iPad ios

Versions (?)

Who likes this?

4 people have marked this snippet as a favorite


iPad/iPhone Orientation Body Class

 / Published in: jQuery

This function will detect the orientation (portrait/landscape) of an iOS device and set the body class to either portrait or landscape, as well as providing a global variable for use elsewhere in your JS.

If you require multiple classes on your body tag, simply alter the code to use jQuery's addClass() and removeClass() functions.

Report this snippet  

You need to login to post a comment.