dojo.addOnLoad(function() { //run once on start up and then on each onorientationchange var orientation = window.orientation; /* orientation values: 0 portrait mode 90: landscape mode with the screen turned to the left -90: landscape mode with the screen turned to the right */ var height = window.innerHeight; var div = dojo.byId('footerDiv'); height -= 50; div.style.marginTop = height.toString() + "px"; window.onorientationchange = function() { console.log(" Height: " + window.innerHeight); var height = window.innerHeight; var div = dojo.byId('footerDiv'); height -= 50; div.style.marginTop = height.toString() + "px"; } });