title: How to create this condition in jQuery?
body: <p>I want to make a jQuery code that does this:</p>
  
  <p>If an element with class <code>'slide1', 'slide2' or 'slide3'</code> has also class <code>"on"</code>, then find an element with class <code>'slide-1', 'slide-2' or 'slide-3'</code> change its opacity to <code>1</code> and change opacity of others to <code>0</code>.</p>
  
  <p><em><strong>Note:</strong> Element 'slide1' is "paired" with 'slide-1', etc. So if 'slide1' has class "on", 'slide-1' should have opacity set to 1 and 'slide-2' and 'slide-3' should have opacity set to 0.</em></p>
  
  <p>Elements 'slide1, ...' are radio buttons for the slideshow:</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div class="slider-radio-buttons"&gt;
    &lt;div class="on slide1"&gt;&lt;/div&gt;
    &lt;div class="off slide2"&gt;&lt;/div&gt;
    &lt;div class="off slide3"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>jQuery:</strong></p>
  
  <pre><code>$(".slider-radio-buttons").on('click', '.off', function() {
      $(".on").removeClass('on').toggleClass('off');
      $(this).toggleClass('on').removeClass('off');
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/UyKzf/5/" rel="nofollow">http://jsfiddle.net/UyKzf/5/</a></p>
  
  <p><strong>IMPORTANT:</strong> Radio buttons are working great, I just need to pair them with slides in slideshow (slide-1, ...) and set opacity of the one, that is turned on, to 1.</p>