Trouble with click not unbinding
<p>I'm building a small adventure to help me understand some concepts of JQuery/Javascript and I've hit a snag.</p>

<p>What I'm trying to do is by clicking on a "take" button and then on an item on the screen to move it to the inventory. Good news is, that all works. Bad news is that if I press another item without using the "take" button first it goes straight to my inventory.</p>

<p>Same problem with "look". You should have to press "look" first and then the item to get a description, but once it's pressed it'll give every item you click a description straight away.</p>

<p>You can imagine that once you've pressed them both every item you click without clicking another button will give you a description and end up in your inventory straight away.</p>

<p>This is how I'm trying to get it to unbind:</p>

<pre><code>$("#take").click(function () {
    $("#zilverenKogel").click(function () {
        $("#zilverenKogel").fadeOut(1200, 0);
        $("#invKogel").fadeTo(1500, 1);
        $("#take").unbind("click");
</code></pre>

<p>Any help will be greatly appreciated!</p>

<p>Mofx solved it for me. End, and working result, is:</p>

<pre><code> var state = null;
$( "#take" ).click(function () {state = "take";})
$( "#look" ).click(function () {state = "look";})


$( "#zilverenKogel" ).click(function () {
    if (state == "take") {
        $("#zilverenKogel").fadeOut(1200, 0);
        $("#invKogel").fadeTo(1500, 1);
      state=null;
    } else if (state == "look") {
        alert("blablabla");
       state=null;
    }

});
</code></pre>

<p>thanks a lot Mofx!</p>
