title: Use a true false statement to control a click function
body: <p>I have three separate "#boxes" that .slideToggle independently when a specific .click occurs to each one's "#switch". I'd like to add a "#masterSwitch" that controls all three "#boxes" at the same with a .slideOpen or .slideClose. The trick is getting  all three "#boxes" to all close or open at the same time, regardless of their current state. (one may be open, one may be closed, so .slideToggle won't offer the right solution). So I want to create a true or false statement to tell the "#masterSwitch" what to do. Any suggestions to get this written correctly?</p>
  
  <pre><code>// Master Box Control
  $('#masterSwitch').click(function(){
      if ($('#box01').is(":visible")) {
          $('#masterSwitch').is(true);
      } else {
          .is(false);
      });
  
      if ($('#box02').is(":visible")) {
          $('#masterSwitch').is(true);
      } else {
          .is(false);
      });
  
      if ($('#box03').is(":visible")) {
          $('#masterSwitch').is(true);
      } else {
          .is(false);
      });
  
      if ($('#masterSwitch').is(true)) {
          $('#box01', '#box02', '#box03').slideOpen(function()
      });
  
      if ($('#masterSwitch').is(false)) {
          $('#box01', '#box02', '#box03').slideClose(function()
          });
      });
  
      // Seperate Box Controls
      $('#box01Switch').click(function() {
          $('#box01').slideToggle();
      });
  
      $('#box02Switch').click(function() {
          $('#box02').slideToggle();
      });
  
      $('#box03Switch').click(function() {
          $('#box03').slideToggle();
      });
  </code></pre>
  
  <p>Thanks in advance, and please pardon my poor syntax.</p>