Create a listener to handle device orientation
var handleDeviceOrientation = function(){
window.addEventListener("orientationchange", function() {
// angle = 0° = portrait
if(screen.orientation.angle == 0){}
// angle = 90° = landscape
else{}
}, false);
};