title: Have to click twice on jQuery
body: <p>Hi. I have the following code that can also be seen live here: <a href="http://designliving.tk/test.html" rel="nofollow">http://designliving.tk/test.html</a> When you click on "View 360" the <code>&lt;div&gt;</code> and Text changes as you can see. </p>
  
  <p>When you click on "this is an image" it should reset it back to "View 360" which it does. </p>
  
  <p>Now the only problem is that when you click on "this is an image" you have to click on "view 360" twice to get the DIV to change again. </p>
  
  <p>It should change on the first click. I have tried rearranging my code with no success.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    $(document).ready(function(){
      $('#toggleDiv').toggle(function() {
        $('#imgThree').show();
        $('#imgNorm').hide();
        $(this).html('&lt;a href="#"&gt;View Normal&lt;/a&gt;');
      }, function() {
        $('#imgThree').hide();
        $('#imgNorm').show();
        $(this).html('&lt;a href="#"&gt;View 360&lt;/a&gt;');
      });
      $('#changeDiv').click(function() {
        $('#imgThree').hide();
        $('#imgNorm').show();
        $('#toggleDiv').html('&lt;a href="#"&gt;View 360&lt;/a&gt;');
      });
    });
  &lt;/script&gt;
  
  &lt;style type="text/css"&gt;
    #imgThree {
      display: none;
    }
  &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
  &lt;div id="toggleDiv"&gt;&lt;a href="#"&gt;View 360&lt;/a&gt;&lt;/div&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;div id="imgNorm"&gt;Normal Product Image Here&lt;/div&gt;
  &lt;div id="imgThree"&gt;360 Spin Image Here&lt;/div&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;div id="changeDiv"&gt;
  &lt;a href="#"&gt;This is an image&lt;/a&gt;&lt;br&gt;
  &lt;a href="#"&gt;This is an image&lt;/a&gt;&lt;br&gt;
  &lt;a href="#"&gt;This is an image&lt;/a&gt;
  &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thank you all for helping.</p>