I think caching was part of the issue on my emulator. So initial loading of the example will not cause the values to populate, however by clicking on the menu button it triggers the resize event or something which will then cause the function to trip. But, when i had an alert statement in there it just kept getting executed in an infinite call. Not sure if it was due to the alert popping or that the menu was up causing a constant evt.
So I modified the code slightly to include at the top of the page a var called.
var lastRotationText = null;
and then at the end of the example put a conditional in place. If you can tell me, would this conditional fire when the rotation toggles between portrait and landscape?
if(lastRotationText != rotationText){
alert('lastRotationText: ' + lastRotationText);
lastRotationText = rotationText;
// I'm not sure how this line actually works but reads to me as tell the window to fire some jquery function reorient
// which will in turn cause the $(window).bind(canDetect ? "orientationchange" : "resize", function(evt) {
// to fire once again.
$(window).trigger("reorient", [orientation, rotationText]);
}
Please correct me if I am incorrect.