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.

herrpedro

Trainee

  • "herrpedro" started this thread

Posts: 149

Location: Lisbon

Occupation: Programmer/analyst

  • Send private message

1

Monday, December 16th 2019, 12:31pm

handling hotspot and layer click in general

hi all,

Is there a way to create a generic event that so that a click in a hotspot or layer triggers my custom event ?
Like adding a tracelog saying "hotspot gotoKitchen was clicked" or "layer layerThumbs was clicked" without cycling through all of them with .addevent("onclick"... )?

Thank you.

herrpedro

Trainee

  • "herrpedro" started this thread

Posts: 149

Location: Lisbon

Occupation: Programmer/analyst

  • Send private message

3

Monday, December 16th 2019, 2:17pm



Thank you for your reply but...
If I add that line will it affect all the layers and hotpots in a tour instantly?

Like
<event onClick="trace(clicked) " > affects all click

Same thing for clicking a hotspot without adding styles or onclicks to all of them

Scott Witte

Intermediate

Posts: 314

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

4

Monday, December 23rd 2019, 4:28pm

Personally I hard code such tracing into the buttons I want to monitor, but if you want something more generic I would suggest using the events.onclick that you mentioned above. In the action triggered you can report or trace back the name of the layer or hotspot clicked. You can filter for just those that have their own onclick events or any other type of filtering.

I haven't tested this but seems it should work.

5

Monday, December 23rd 2019, 4:35pm


Thank you for your reply but...
If I add that line will it affect all the layers and hotpots in a tour instantly?


No, it will affect only the layer you add it to.

<layer name="mybutton" .... onclick="trace('whee, i was clicked!');" />