You are not logged in.

1

Sunday, October 4th 2009, 10:20am

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?

This post has been edited 1 times, last edit by "nmakarov" (Oct 4th 2009, 10:57am)


2

Monday, October 5th 2009, 11:47am

Hi,

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

js:

Source code

1
2
3
4
if (krpano && krpano.call)
{
...
}



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

js:

Source code

1
2
3
4
function krpano_is_ready()
{
...
}

xml:

Source code

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


best regards,
Klaus

3

Tuesday, October 6th 2009, 12:22am

Thanks, Klaus.