You are not logged in.

xhe

Beginner

  • "xhe" started this thread

Posts: 37

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: 1,117

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • 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
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

xhe

Beginner

  • "xhe" started this thread

Posts: 37

Location: Sunnyvale, California, USA

  • Send private message

3

Sunday, July 7th 2019, 5:22pm

works well

exactly what I am looking for! Thanks