title: addClass() then removeClass() on click (jquery)
body: <p>.I'm trying to make some gallery.
  Want to use addClass to show image and then click on same place to remove this new class
  I googled for help, but after hour of trying to get it work normally, i'm asking you for help.
  I found here solution for reversed option (first remove and add)</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;html&gt;
   &lt;script type="text/javascript" src="http://www.s-ola.me/js/jquery.js"&gt;&lt;/script&gt;
   &lt;script type="text/javascript" src="http://www.s-ola.me/js/jquery.nailthumb.1.1.min.js"&gt;&lt;/script&gt;
  &lt;style&gt;
  
  #window {
  width:              570px;
  height:             455px;
  position:           relative;
  background-color:   grey;
  padding:            20px;
  margin:             0 auto;
  top:                50%;
  margin-top:         -225px;
  }
  
  .image {
  display:    inline-block;
  margin:     5px;
  }
  
   #wrapper {
  width:              568px;
  height:             455px;
  position:           absolute;
  }
  
  .close {
  display:    none;
  }
  .big_image{
  width:      100%;
  display:    block;
  }
  &lt;/style&gt;
  &lt;body&gt;
  
  &lt;div id="window"&gt;
  &lt;div id="wrapper"&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
      &lt;img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  
  $(document).ready(function(){
  $('.image').nailthumb({containerClass:'image',height:100, width:100, fitDirection:'center', proportions:0.5, maxShrink:0.5});
  })
  
  $(document).ready(function(){
  
  $('img').click(function(){
      $('.image').toggleClass('close');
      $('#wrapper').append('&lt;img src="'+this.src+'" class="big_image" /&gt;');
  })
  
  })
  $(document).ready(function(){
  $('.big_image').click(function(){
      if($('.big_image')) {$('.big_image').remove(); $('.image').toggleClass('close'); }
  })
  
  })
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please let me know where i mistaken. </p>
  
  <p>Thanks again.
  Alexei
  alexela.biz</p>
  
  <hr>
  
  <p>Updated</p>