How do I know if panorama is fully loaded and ready to use from javascript?

  • I can use things like krpano().call(...) assigned to some HTML buttons and it works perfectly. But if I try it from window.onload, I have a javascript error:krpano().call is not a function.
    I could have used a few seconds delay before calling krpano() functions, but it is not really cool. Any ideas how can I check whenever krpanoSWFObject is ready to manipulate without causing javascript errors?

    Einmal editiert, zuletzt von nmakarov (4. Oktober 2009 um 10:57)

  • Hi,

    one way would be to check in JS if the krpano object and the function are available:

    js:

    Code
    if (krpano && krpano.call)
    {
    ...
    }


    or a other way - use a kind of 'start' javascript function and call it from krpano,

    js:

    Code
    function krpano_is_ready()
    {
    ...
    }


    xml:

    Code
    <krpano onstart="js( krpano_is_ready() );">
    ...

    best regards,
    Klaus

Jetzt mitmachen!

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