window.orientation always seems to have the correct value if polled. But I don't know of a reliable strategy for using event handlers to track the state of window.orientation.
I have created a test program and put it in the iui samples directory on Google Code: http://iui.googlecode.com/svn/trunk/samples/orient.html 1) Load this page on your iPhone 2) Touch the "link out" link 3) Wait for the "Static" page to load 4) Change the orientation on your phone 4) Click the back button on your iPhone 5) Notice that three indicators of orientation read "unknown" (The "Load Events" indicator should have original orientation listed) 6) Click the "Read window.orientation" javascript link 7) You'll notice that "Manual State" now correctly indicates orientation The source for this page is really simple (based upon Apple's sample code) So, does anyone have an idea for how to track all orientation changes without using setInterval()? -- Sean Peter Blazejewicz wrote: > hi, > > "window.orientation" {0, 90, -90} > does it work in use cases raised in first post? > > regards, > Peter > > On May 30, 10:18 am, Chrilith <[EMAIL PROTECTED]> wrote: > >> Could you be more specific? >> >> On May 30, 12:16 am, Peter Blazejewicz <[EMAIL PROTECTED]> >> wrote: >> >> >>> hi guys, >>> >>> except of Window event there is a window orientation property if my >>> memory serves me correctly, is there? >>> >>> regards, >>> Peter >>> >>> On May 28, 10:06 am, Chrilith <[EMAIL PROTECTED]> wrote: >>> >>>> No, this seems to be more a limitation (bug?) of Safari >>>> >>>> On May 27, 10:35 pm, Sean Gilligan <[EMAIL PROTECTED]> wrote: >>>> >>>>> Using onload and onorientation handlers I can track the orientation >>>>> state of the page without needing to use setInterval(), except for (at >>>>> least) the following case: >>>>> >>>>> 1. Page is loaded in portrait mode >>>>> 2. User follows a link to another page >>>>> 3. User rotates the iPhone while viewing the other page >>>>> 4. User uses the back button in Safari >>>>> >>>>> When the page is redrawn, neither the onload or onorientation handlers >>>>> will fire. >>>>> >>>>> Has anyone solved this problem without using setInterval to poll? >>>>> >>>>> Thanks, >>>>> >>>>> Sean >>>>> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to iphonewebdev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en -~----------~----~----~----~------~----~------~--~---