Can I determine if a device is in portrait or landscape mode using jquery?
javascript, jquery, jquery-mobile, landscape-portrait, screen-orientation
Solution
Try the `orientationchange` event handler, something like this:
$(window).bind("orientationchange", function(evt){
alert(evt.orientation);
});
Here's the jQuery Mobile entry on detecting and firing the `orientationchange` event.
Problem
I want to conditionally alter what the user sees on the photo gallery web site I'm going to create based on if the device being used to view the site is in portrait/vertical vs. landscape/horizontal mode/orientation. Is this possible?