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.

xhe

Beginner

  • "xhe" started this thread

Posts: 12

Location: Sunnyvale, California, USA

  • Send private message

1

Saturday, July 6th 2019, 8:03pm

how to dispatch event when one hotspot is clicked?

I am looking for a solution to link krpano with external javascript.
What I want is I set up a hotspot on krpano, and when user click that hotspot, it will dispatch the client event and this event is intercepted by external javascript, so that I will know what object user is selected.

such as:


<hotspot name="hs56313" style="roomspot|skin_tooltips" tooltip="get:scene[lr].title" onclick="select(this);">
<point ath="-18.4" atv="1.4"/>
<point ath="-19.2" atv="7.1"/>
<point ath="-4.6" atv="9.9"/>
<point ath="20.6" atv="0.0"/>
</hotspot>

then in javascript:

select(obj){
console.log(onj)
}

is this possible?

Thanks

spacerywirtualne

Professional

Posts: 874

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Saturday, July 6th 2019, 9:48pm

Hi,
can you use this action?

https://krpano.com/docu/actions/#js


eg. onclick="js('select(',get(name),');')"

Piotr
You own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: facebook group :: youtube

cms4vr team *thumbsup*

xhe

Beginner

  • "xhe" started this thread

Posts: 12

Location: Sunnyvale, California, USA

  • Send private message

3

Sunday, July 7th 2019, 5:22pm

works well

exactly what I am looking for! Thanks