Toggle / Open and Close States

  • Hi,

    there are more possibilities to do this:

    1. change the onclick function:

    • there are 2 actions
    • one action for closeing
    • and one action for opening
    • in every action the onclick funtion is set to the other action

    example xml - a button to show and hide a infoscreen:


    2. use the new IF function: (1.0.8 beta 4 or higher)

    • use some of the existing variable (e.g. visible or enabled)
    • or create a own variable (e.g. state)
    • check this variable and decide what to do

    xml example:

    best regards,
    Klaus

  • What a truly great piece of software! Unfortunately I'm having a difficult time implementing this IF statement... I can get it to work without the IF - i.e. onclick="action(openaction);" - any suggestions? Great work Klaus!

  • What a truly great piece of software! Unfortunately I'm having a difficult time implementing this IF statement... I can get it to work without the IF - i.e. onclick="action(openaction);" - any suggestions? Great work Klaus!


    Try this
    onclick="if(state == closed, action(openaction), action(closeaction));"

  • Thanks for the help, it works!
    ===============
    Two things - for those who are trying to figure things out too...

    I was negligent in replacing my krpano.swf with the 1.0.8beta5 - so it wouldn't work regardless!

    I replaced my old krpano.swf (1.0.7) with the new one (1.0.8Beta5) - still didn't work with original code (mine).

    I followed above suggestion and it worked - just had to remove 2 "space" characters in the appropriate spots.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!