Hi! I want to share a code example of how to show/hide groups of hotspots.
example
http://novosibpano.ru/VT/groupHS/
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<action name="hide_show" scope="local" args="gr" >
for(set(i,0), i LT hotspot.count, inc(i),
copy(hs, global.hotspot[get(i)]);
txtreplace(dstvar, gr, get(hs.group),);
if(hs.group,
if(dstvar !== gr,
set(hs.enabled, true);
set(hs.visible, true);
,
set(hs.enabled, false);
set(hs.visible, false);
);
);
);
</action>
|
Add the attribute to hotspots:
group="red"
red is the name of the group
To show the group call the action :
hide_show('red');
Hide hotspots that belong to other groups, if only they have a group.
To show multiple groups, simply list them in parentheses separated by commas: hide_show('green, red');
Only for local hotspots