need help creating action/plugin - ipad orientation

  • he sacha,

    but how to achieve that?

    Zitat

    Turn the iphone accessibilty zoom to off.

    Or reset the size of your pano div to 100% width and height.

    i have this in the index:

    Code
    <script>
    function resizekrpano() 
    {
     
     document.getElementById("pano").style.height = document.body.clientHeight + "px";;
     document.getElementById("pano").style.width = document.body.clientWidth + "px";;
     
    }
    </script>

    an dthis in the xml:

    seems not to work ... but i'm not good in .js..

    Tuur *thumbsup*

  • First of all, thanks for your effort you put into this plugin, ahoeben! But I can´t get it to work, either on iPad nor on iPod touch. Even the demo you have on your page is´nt working on these devices, because it shows only "the device is in portrait orientation", no matter how I rotate the device *sad* Any idea where the problem might be?

    And does anybody else got this plugin to work?

    Thanks in advance,
    Nupsi

  • The reason the demo wasn't working was because it is running inside an iframe on the documentation page, and the orientationchange event is not propagating across the iframe. I have changed the plugin to look at the top window instead. This should work, as long as the krpano page and the containing page are on the same domain.

  • Hi,

    here a simplified example for getting the device orientation (for latest browsers only, older browser have also different ways of storing that information):

    Code
    <action name="get_orientation" type="Javascript"><![CDATA[
      krpano.display.orientation = screen.orientation && screen.orientation.type ? screen.orientation.angle : window.orientation;
    ]]></action>
    
    
    <events name="test" keep="true"
      onresize="get_orientation(); trace('orientation=',display.orientation);"
      />

    Should work on Android Chrome, Firefox and iOS.

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!