title: Toggling an image src with jQuery
body: <p>I wrote some code to toggle the src of an image and also to pause/resume the jQuery cycle2 plugin.</p>
  
  <p>I'm not sure why it isn't working and would appreciate some help.</p>
  
  <pre><code>$('.play-pause').click(function(){
      if ($(this).attr('src', '/images/template/pause.png')) {
          $(this).attr('src', '/images/template/play.png');
          $('.cycle-slideshow').cycle('pause');   
      } else if ($(this).attr('src', '/images/template/play.png')) {
          $(this).attr('src', '/images/template/pause.png');
          $('.cycle-slideshow').cycle('resume');
      }
  });
  </code></pre>
  
  <p>If I remove the 'else if' statement the first 'if' statement works.</p>
  
  <p>Thanks for the help.</p>
  
  <p>Jeff</p>