3 Replies Latest reply on Oct 16, 2014 3:18 AM by jamesfootlight

    Hide Show toggle issue - can u help?

    jamesfootlight Level 1

      Hi, I have a toggle issue!

       

      I have four buttons that each hide show toggle different squares:

       

      button 1 shows yellow and hides green, green1 and blue

      button2 shows green and hides yellow, green1 and blue

      button3 shows green 1 and hides yellow, green and blue

      button4 shows blue and hides yellow, green and green1


      However, if you press button1 and then press button2 the sequence gets confused and hides/shows the wrong ones!

       

      Can you help to ensure that whatever button is pressed it will hide show the correct formation whether you toggle or not?

       

      here is my code for one button1 etc:

       

      // Set a toggle to hide or show an element

      if (sym.$("Green").is(":visible")) {

        sym.$("Green").hide();

      } else {

        sym.$("Green").show();

      }

       

       

      // Set a toggle to hide or show an element

      if (sym.$("Green1").is(":visible")) {

        sym.$("Green1").hide();

      } else {

        sym.$("Green1").show();

      }

       

       

      // Set a toggle to hide or show an element

      if (sym.$("Blue").is(":visible")) {

        sym.$("Blue").hide();

      } else {

        sym.$("Blue").show();

      }

       

      Can you help?