I have a JQM app with a fixed footer. In order to get around a rendering issue when the keyboard is shown, I found some CSS3 media queries that set the visibility of the .ui-footer-fixed class to visible if the min-height of the screen is more than a certain number of pixels based on the orientation.
The portrait mode screen size and orientation is detected correctly and shows/hides the class as I would expect when the keyboard is displayed and hidden. When in landscape mode, however, the landscape orientation is not detected and the default visibility of hidden takes over.
This is the pertinent script that sets up these media queries:
var win = $(window),
height = win.height(),
width = win.width();
document.write([
"<style>",
".ui-footer-fixed { visibility: hidden; }",
"@media screen and (orientation: portrait) and (min-height: " + (Math.max(width, height) - 10) + "px)",
"{ .ui-footer-fixed { visibility: visible; }",
"@media screen and (orientation: landscape) and (min-height: " + (Math.min(width, height) - 30) + "px)",
"{ .ui-footer-fixed { visibility: visible; }",
"</style>"
].join(" "));
What am I doing wrong?
Thanks, Matthew