Skip to content

Instantly share code, notes, and snippets.

View brianswisher's full-sized avatar

Brian Swisher brianswisher

View GitHub Profile
@brianswisher
brianswisher / orientation.js
Created September 23, 2011 23:00
A mobile web dev script to toggle through portrait & landscape classes on a document's body element.
/*global document */
var orientation;
(function () {
"use strict";
orientation = function () {
var isPortrait, isLandscape;
isPortrait = document.body.className.indexOf('portrait') !== -1;
isLandscape = document.body.className.indexOf('landscape') !== -1;
document.body.className = document.body.className.split(' portrait ').join('');
document.body.className = document.body.className.split(' landscape ').join('');