{"comment":{"created_at":"2011-10-21T16:47:24Z","body":"Hi, \r\nyeah that was my first thought but having two layers 768x1024 and 1024x1488 in one html page causes the body of the page to stay at 1024x1488 (so when the portrit version of the page is showing youve scroll bars and white space where the larger layer is sitting \"hidden\". Not sure if thats a ipad only situation or universally true but it pushed me to look at creating two seperate pages.\r\n\r\nWhat method dyou use to check orientation / a change in the orientation? ","updated_at":"2011-10-21T16:47:24Z","url":"https://api.github.com/repos/Simbul/baker/issues/comments/2483489","id":2483489,"user":{"gravatar_id":"72c3306663797db50a7755f5b1f14c21","avatar_url":"https://secure.gravatar.com/avatar/72c3306663797db50a7755f5b1f14c21?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/k8fisher","id":457748,"login":"k8fisher"}},"action":"created","issue":{"number":184,"created_at":"2011-10-21T16:01:21Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi\r\nIm trying to create a publication which makes use of matchMedia to switch between portrait and landscape versions of pages. Im using matchMedia and listeners, along the lines of...\r\n\r\nvar mql = window.matchMedia(\"(orientation: portrait)\");   \r\nmql.addListener(handleOrientationChange);   \r\nhandleOrientationChange(mql); \r\n\r\nfunction handleOrientationChange(mql) {   \r\n   if (mql.matches) {   \r\n      top.location.href=\"portraitVersion.html;\"\r\n    } else {   \r\n      top.location.href=\"landscapeVersion.html;\" \r\n         }   \r\n   }  \r\n\r\nI dont see any change in page layout when running this on an ipad, is there any reason why matchMedia isnt firing when the ipad is rotated? I need to use javascript rather than css to as the pages (jpgs) need to have imagemaps assigned to them.\r\n\r\nAny thoughts on detecting orientation change and switching page very much welcome. Unfortunately I *have* to change web page rather than use css to stretch the jpg to fit the orientation :/\r\n\r\nKate","comments":2,"title":"Using matchmedia to test the orientation of the ipad","updated_at":"2011-10-21T16:47:25Z","url":"https://api.github.com/repos/Simbul/baker/issues/184","id":2016917,"assignee":null,"milestone":null,"closed_at":"2011-10-21T16:47:25Z","user":{"gravatar_id":"72c3306663797db50a7755f5b1f14c21","avatar_url":"https://secure.gravatar.com/avatar/72c3306663797db50a7755f5b1f14c21?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/k8fisher","id":457748,"login":"k8fisher"},"html_url":"https://github.com/Simbul/baker/issues/184","labels":[{"name":"Discussion","url":"https://api.github.com/repos/Simbul/baker/labels/Discussion","color":"dee102"}],"state":"closed"},"legacy":{"issue_id":2016917,"comment_id":2483489}}