Skip to content

Instantly share code, notes, and snippets.

@inancsevinc
Created June 10, 2012 10:11
Show Gist options
  • Save inancsevinc/2904789 to your computer and use it in GitHub Desktop.
Save inancsevinc/2904789 to your computer and use it in GitHub Desktop.
jQuery Mobile orientation change handler, using cordova camera api
$(window).on('orientationchange', function(event) {
if (event.orientation) {
if (event.orientation == 'portrait') {
//do something
} else if (event.orientation == 'landscape') {
navigator.camera.getPicture(onSuccess, onFail, {quality: 20});
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment