You are not logged in.

1

Wednesday, January 1st 2014, 2:19pm

Toggle Button Help

I've created 2 buttons - 1 to turn the floor plan map On and another to turn if Off. Would anyone be able to modify my code below so that it is just one button that toggles On and Off?? Thanks! Using 2 buttons shows how much I really dont know.

(code in vtourskin.xml <style name="plan" url="plan_open.png" /> )...


Buttons:


<layer name="skin_btn_plan_open" style="plan|skin_glow" align="leftbottom" x="130" y="4" scale="1.0" onhover="showtext('Floor Plan', SKIN_TOOLTIPS);" ondown2="set(plugin[plan].visible, true);" />

<layer name="skin_btn_plan_close" style="plan|skin_glow" align="leftbottom" x="185" y="4" scale="1.0" onhover="showtext('Close Plan', SKIN_TOOLTIPS);" ondown2="set(plugin[plan].visible, false);" />

Tuur

Sage

Posts: 3,839

Location: Netherlands

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

  • Send private message

2

Wednesday, January 1st 2014, 2:23pm

Source code

1
ondown2="if(plugin[plan].visible == true, set(plugin[plan].visible,false);, set(plugin[plan].visible,true));

Hope it helps
Tuur *thumbsup*

3

Wednesday, January 1st 2014, 2:37pm

That worked GREAT! THANK YOU - I spent new years trying to do that.

Got the others working too - thanks again.

This post has been edited 1 times, last edit by "Garrett" (Jan 1st 2014, 3:00pm)