title: How to disable a Javascript Function when a different one is Enabled?
body: <p>I have this function:</p>
  
  <pre><code>$(document).ready(function(){   
      function Fos(buttonSel, inputSel, someValue, cssProperty) {
          $(buttonSel).click(function(){   
              var value = $(inputSel).attr("value");
              $("div.editable").click(function (e) { 
  
                  e.stopPropagation();
  
                  showUser(value, someValue, this.id)
                  var css_obj={};
                  css_obj[cssProperty]=value;
                  $(this).css(css_obj);  
              });        
          });        
      }   
  </code></pre>
  
  <p>Here are three places where function is written:</p>
  
  <pre><code>Fos('#border_button', '#border-radius', 2, '-webkit-border-radius');
  Fos('#background_color_button', '#background-color', 1, 'background-color');
  Fos('#opacity_button', '#opacity', 3, 'opacity');
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;input type="text" id="border-radius" value="20px"&gt;
  &lt;div id="border_button"&gt;BORDER RADIUS&lt;/div&gt;
  &lt;input type="text" id="background-color" value="red"&gt;
  &lt;div id="background_color_button"&gt;Background&lt;/div&gt;
  &lt;input type="text" id="opacity" value=".5"&gt;
  &lt;div id="opacity_button"&gt;Opacity&lt;/div&gt; 
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;div id="2" class="defaultclass editable" style="&lt;?php getStyle('2') ?&gt;"&gt;
      something
  &lt;/div&gt;
  </code></pre>
  
  <p>When you click the DIV with the ID= "border_button", or "background_color_button", or "opacity_button"
  it waits for you to click any DIV with <code>class="editable"</code>, ...<code>$("div.editable").click(function (e) {</code>... it executes the function with those parameters.</p>
  
  <p><strong>I just need a fix that will only allow ONE function with the parameters to be enabled at one time.</strong></p>
  
  <p>Currently, when you click on all three divs with ID = "border_button", or "background_color_button", or "opacity_button" AND THEN on a div with class="editable", it executes the function with ALL THREE sets of parameters.</p>
  
  <p>This is bad. I can't figure it out.</p>