Skip to content

Instantly share code, notes, and snippets.

@thelinuxlich
Created October 10, 2012 20:58
Show Gist options
  • Save thelinuxlich/3868370 to your computer and use it in GitHub Desktop.
Save thelinuxlich/3868370 to your computer and use it in GitHub Desktop.
script.js
$(function() {
$.stayInWebApp();
function reorient(e) {
var landscape = (window.orientation % 180 == 90);
$("body > div").css("-webkit-transform", !landscape ? "rotate(90deg)" : "")
.css("-webkit-transform-origin", "512px 512px");
}
window.onorientationchange = reorient;
window.setTimeout(reorient, 0);
function reorient2(e) {
var landscape2 = (window.orientation % -180 == -90);
$("body > div").css("-webkit-transform", !landscape2 ? "rotate(-90deg)" : "")
.css("-webkit-transform-origin", "512px 512px");
}
window.onorientationchange = reorient2;
window.setTimeout(reorient2, 0);
$('#swiper').on({
'swiperight' : function(ev) {
window.location.href = 'slide1.html';
},
'swipeleft' : function(ev) {
window.location.href = 'slide2.html';
},
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment