title: Need button for show/hide image rotation href added to javascript code
body: <p>I have the following script, which when you click the image within the div, it opens the corresponding a href link in a new window. At the same time, the div that was clicked on the parent page becomes hidden, and the next div is shown.</p>
  
  <p>There is also a "next" button, so in order to advance to the next div without clicking the image. This "next" button does not open the corresponding a href on the current div. It just skips to the next div.</p>
  
  <p>This is all working perfectly, however I'm trying to now add a button that when clicked will take you to the href location of the visible div.</p>
  
  <p>Does that make sense?</p>
  
  <p>Here's a JSFiddle Demo: <a href="http://jsfiddle.net/QTyRq/" rel="nofollow">http://jsfiddle.net/QTyRq/</a></p>
  
  <p>And here's the code...</p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;div class="imgrotation"&gt;&lt;a href="http://google.com" target="_blank"&gt;&lt;img src="abc.jpg" width="100" height="100" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;
      &lt;div class="imgrotation"&gt;&lt;a href="http://yahoo.com" target="_blank"&gt;&lt;img src="def.jpg" width="200" height="200" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;
      &lt;div class="imgrotation"&gt;&lt;a href="http://msn.com" target="_blank"&gt;&lt;img src="ghi.jpg" width="300" height="300" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;
      &lt;div class="imgrotation"&gt;&lt;a href="http://bing.com" target="_blank"&gt;&lt;img src="jkl.jpg" width="400" height="400" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;button id="nextimg"&gt;Next Image&lt;/button&gt;
  
  &lt;!--This is what I need added to JS --&gt;
  &lt;button id="gotourl"&gt;Visit Site&lt;/button&gt;
  </code></pre>
  
  <p>Jquery:</p>
  
  <pre><code>var alldoneURL = 'next-image-group.html'; //final click
  function next(event, duration) {
      duration = duration || 900; // default value
      var that = $('.imgrotation:visible');
      if (that.next('.imgrotation').length) {
          that.fadeOut(duration, function() {
              that.next('.imgrotation').fadeIn(duration);
          });
      } else {
          window.location.href = alldoneURL;
      }
      return false;
  }
  
  $('.imgrotation').not(':first').hide();
  $('.imgrotation a').click(
  
  function(e) {
      e.preventDefault();
      var newWin = window.open(this.href), //(this.href, 'newWindow') to load all clicks in one window.open
          duration = 900;
      next(e, duration);
  });
  $('#nextimg').click(next);
  </code></pre>
  
  <p>​</p>