Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
estevesd committed Jun 2, 2013
0 parents commit 80baa1f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions jquery.jorient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var $o = {
b : $('body'),
w : $(window),
a : void 0,
v : $(document.getElementsByName("viewport")),
c : function (o) { return o ? "portrait" : "landscape"; },
u : function() {
var o = $o.a,
wo = window.orientation;
if (wo) {
$o.a = wo === 0 || wo == 180 ? 1 : 0;
} else {
$o.a = $o.w.width() > $o.w.height() ? 0 : 1;
}
if (typeof(o) === 'undefined' || o !== $o.a) {
var fo = $o.c($o.a),
fv = $o.a ? "width" : "height",
oo = typeof(o) !== 'undefined' ? $o.c(o) : void 0;
$o.b.addClass(fo).removeClass(oo);
$o.v.attr('content', 'width=device-' + fv + ',initial-scale = 1');
}
}
};
$o.u();
$o.b.on("orientationchange", $o.u);
$(window).on("resize", $o.u);
1 change: 1 addition & 0 deletions jquery.jorient.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 80baa1f

Please sign in to comment.