You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, February 9th 2012, 5:24am

How to use the vars object with embedpano?

Is there any documentation for how to use the vars object to set krpano variables when using the embedpano() function? What is the syntax?
Regards,
Karel

2

Tuesday, February 14th 2012, 5:54pm

Hi,

that's a Javascript Object, and you can define the variables with it's values as properties of that object,

e.g.

Source code

1
embedpano({xml:"krpano.xml", target:"krpanoDIV", vars:{onstart:"trace(hello)", simulatedevice:"UserAgent"}});


or create the vars object before the embedding and then pass it:

Source code

1
2
3
4
5
var vars = {};
vars["onstart"] = "trace(hello);";
vars["plugin[test].url"] = "test.jpg";
...
embedpano({xml:"krpano.xml", target:"krpanoDIV", vars:vars}});


best regards,
Klaus

3

Tuesday, February 14th 2012, 6:01pm

Thanks Klaus :)