You are not logged in.

1

Monday, March 5th 2018, 7:19pm

changing multiple hotpot by modifying their related <style> element

Is it possible to change multiple hotspot appearance by modifying the <style> element to which they refer ?

I tried but it seems like it doesn’t work:

Source code

1
onclick="toggle(style[styleSkiLifts.visible)"


Would be convenient though..

spacerywirtualne

Professional

Posts: 909

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Tuesday, March 6th 2018, 9:56am

Hi
Is it possible to change multiple hotspot appearance by modifying the
Use SET or COPY or CALC for this.

If you want to change the all hotspots then you will need a FOR action.

Source code

1
2
3
  for(set(i,0),i LT hotspot.count,inc(i),
   set(hotspot[get(i)].variable, newvalue);
  );


Kind regards
Piotr
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

3

Tuesday, March 6th 2018, 10:33am

Thanks for your answer Piotr *thumbup*

This is what I thought. But then, so modify the appearance of just a subset of hotspot, there is no other way than selecting them one by one by their name I guess (?)

Would be interesting to be able to modify them by their related style, would be pretty flexible, a bit like html + css.

4

Tuesday, March 6th 2018, 10:55am

@ oli :
if you apply a style, all properties not existing on the target get set by the ones defined in the style.
this is done only once when all xml is loaded an parsed.
after that the target is independent of the style.

the thought is nice ofc, but a change would break all existing code :)

Tuur

Sage

Posts: 3,173

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

5

Tuesday, March 6th 2018, 1:19pm

Hi, you could give the hotspots you want to change an extra id or so..
Then use the 'for' loop and 'load style'.

Source code

1
2
3
4
5
6
7
8
9
<hotspot name="bla" id="flex" etc etc />

for(set(i,0),i LT hotspot.count,inc(i),
   if(hotspot[get(i)].id == 'flex',
       hotspot[get(i)].loadstyle(style2);
   );
  );

  


of course it is possible to mix styles like style="style1|style2"
so maybe with a combination of the 'for' loop and the styles you could be smart ;-)

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

6

Tuesday, March 6th 2018, 1:35pm

Thanks indexofrefraction, I didn't know that. That explains.

Thanks Tuur, I guess it's the best way to do what I try to achieve *thumbup* I'll use this method in a case where I have a really big amount of hotspots.

Cheers *thumbsup*

Tuur

Sage

Posts: 3,173

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

7

Tuesday, March 6th 2018, 1:47pm

It works also well for small amounts *g*

Oli from Saas-Fee?

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur