title: jQuery click() just won't work
body: <h2>The problem</h2>
  
  <p>On my page, when a specified <code>&lt;a&gt;</code> is clicked upon, another part of the page is supposed to change. In my case right now I'm trying to fade an image out (in order to show the image behind the first one), but I've tried it with different changes (changing z-index (with <code>.css</code>) or the src (using <code>.attr</code>)). </p>
  
  <p>I'm sure the event is not the problem, it's the trigger. <strong>I even got it to work with the following:</strong> </p>
  
  <pre><code>&lt;a onclick='$("img").toggleClass("active")' class="wr-nav-prev"&gt; 
  </code></pre>
  
  <p>But since I'm really new to javascript (and jQuery) <strong>I don't want to settle for this way.</strong></p>
  
  <p>Trying to do the same this way: </p>
  
  <pre><code>$(".wr-nav-next").click(function(){
      $("img").toggleClass("active");
  });
  </code></pre>
  
  <p>won't work and I cannot find the reason. I changed the selector about a hundred times (the <code>&lt;a&gt;</code> wraps around a span and a div).</p>
  
  <p>I hope you already see the problem and will inform me about my mistake when you are done laughing! :)</p>
  
  <p>If not, maybe those parts of my code will help:
  In the case that you need to see what it looks like: I was trying to rebuild <a href="http://tympanus.net/Tutorials/CircleNavigationEffect/" rel="nofollow">this page / example called "Circle Navigation Effect with CSS3" by Mary Lou from Codrops</a></p>
  
  <h2>The HTML</h2>
  
  <p>A few lines (like the css links) missing. I'm pretty sure they are not important.</p>
  
  <pre><code>&lt;script type="text/javascript" src="jquery-1.7.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="centeritem.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      CenterItem('#wr');
  });
  $(window).resize(function() {
      CenterItem('#wr');
  });
  $(".wr-nav-next").click(function(){
      $("img").toggleClass("active");
  });
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="wr"&gt;
      &lt;div class="wr-nav"&gt; 
          &lt;a onclick='$("img").toggleClass("active")' class="wr-nav-prev"&gt; 
              &lt;span&gt;Previous picture&lt;/span&gt;
              &lt;div&gt;&lt;/div&gt;
          &lt;/a&gt;
          &lt;a class="wr-nav-next"&gt;
              &lt;span&gt;Next picture&lt;/span&gt;
              &lt;div&gt;&lt;/div&gt;
          &lt;/a&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;img class="active" src="Images/large/1.jpg"&gt;
          &lt;img src="Images/large/2.jpg"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>The CSS</h2>
  
  <p>The css is a bit messy since I've been testing stuff with this stylesheet all day and I might have overlooked something while cleaning up.</p>
  
  <pre><code>#wr{
      position: relative;
      width: 820px;
      height: 600px;
      border: 0px solid rgba(153,153,153,1);
      background-color:rgba(0,102,204,0.4);
      -moz-border-radius: 50px;
      -webkit-border-radius: 50px;
      border-radius: 50px;
  }
  
  .wr-nav{
      position:relative;
      width: 770px;
      height: 120px;
      top: 25px;
      left: 25px;
  }
  
  .wr-nav a{
      position:absolute;
      height: 70px;
      width: 70px;
      top: 0px;
  }
  
  a.wr-nav-prev{
      left: 0px;
  }
  
  a.wr-nav-next{
      right: 0px;
  }
  
  .wr-nav a span{
      position: absolute;
      cursor: pointer;
      opacity: 0.9;
      display:block;
      width: 46px;
      height: 46px;
      top: 50%;
      left: 50%;
      margin: -23px 0 0 -23px;
      background-size: 17px 25px;
      text-indent: -9000px;
      -moz-border-radius: 23px;
      -webkit-border-radius: 23px;
      border-radius: 23px;
      -webkit-transition: all 0.4s ease;
      -moz-transition: all 0.4s ease;
      -o-transition: all 0.4s ease;
      -ms-transition: all 0.4s ease;
      transition: all 0.4s ease;
      background-color:rgba(204,204,204,1);
      background-repeat:no-repeat;
      background-position: center center;
  }
  
  .wr-nav a.wr-nav-prev span{
      background-image:url(Images/prev.png);
  }
  
  .wr-nav a.wr-nav-next span{
      background-image:url(Images/next.png);
  }
  
  .wr-nav a div{
      position: absolute;
      cursor: pointer;
      opacity:1;
      width: 0px;
      height: 0px;
      top: 50%;
      left: 50%;
      margin: 0px;
      -moz-border-radius: 0px;
      -webkit-border-radius: 0px;
      border-radius: 0px;
      -webkit-transition: all 0.2s ease-out;
      -moz-transition: all 0.2s ease-out;
      -o-transition: all 0.2s ease-out;
      -ms-transition: all 0.2s ease-out;
      transition: all 0.2s ease-out;
      background-repeat:no-repeat;
      background--position: center center;
  }
  
  .wr-nav a:hover span{
      width: 100px;
      height: 100px;
      -moz-border-radius: 50px;
      -webkit-border-radius: 50px;
      border-radius: 50px;
      margin: -50px 0 0 -50px;
      background-size: 22px 32px;
      background-color:rgba(0,102,204,1);
  }
  
  .wr-nav a:hover div{
      width: 90px;
      height: 90px;
      background-size: 100% 100%;
      margin: -45px 0 0 -45px;
      -moz-border-radius: 45px;
      -webkit-border-radius: 45px;
      border-radius: 45px;
  }
  
  .wr-nav a.wr-nav-prev div{
      background: rgba(255,153,51,1) url(Images/thumbs/1.jpg) no-repeat center center;
  }
  
  .wr-nav a.wr-nav-next div{
      background: rgba(153,153,153,1) url(Images/thumbs/2.jpg) no-repeat center center;
  }
  
  img{
      position: absolute;
      opacity: 0;
      border-top: 3px solid rgba(153,153,153,0.8);
      border-bottom: 3px solid rgba(153,153,153,0.8);
      -webkit-transition: all 0.2s ease-out;
      -moz-transition: all 0.2s ease-out;
      -o-transition: all 0.2s ease-out;
      -ms-transition: all 0.2s ease-out;
      transition: all 0.2s ease-out;
  }
  
  img.active{
      opacity: 1;
  }
  </code></pre>