You are not logged in.

1

Tuesday, October 18th 2016, 10:03pm

A question about the onclick event

Hi krpano enthusiasts,

I have a question about events. Suppose that in my xml I define a hotspot

Source code

1
2
3
4
5
<hotspot name="spot1"
...
 onclick="js(checkclick(1););"

         />


and then at the bottom

Source code

1
<events  onclick="js(checkclick(0);)" />


Now, it seems that if I click on the hotspot, only checkclick(1) gets called. Is it correct?

On the other hand, if I define a layer with some HTML link and click on the link, only checkclick(0) gets called but not always.. and the conditions under which it gets called are not clear to me.

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Wednesday, October 19th 2016, 9:14am

Hi)

Read about onclick event here http://krpano.com/docu/xml/#events.onclick

js(checkclick(0); works when you click inside pano image.


Layers can receive clicks and allow pano be clicked at the same time (read here about capture http://krpano.com/docu/xml/#layer.capture and bgcapture of containers http://krpano.com/docu/xml/#layer.bgcapture ). So if a layer allows pano clicking, then event code will also work when you click that layer.
Regards,

Alexey

3

Wednesday, October 19th 2016, 10:17am

Great, thank you! It seems to work better now.