jquery click function always returns highest value
<p>I insert elements to the DOM, after that I want to bind a click function to these elements.
This works, but for some reason the links that were created all return the same value, which
is the highest value 'px_amount' has after looping. Very strange :) The first console.log();
does return the right value, and I can see it increment after each iteration. I added a simple console.log() to the click function, for sake of simplicity.</p>

<pre><code>for(var i=1; i&lt;=bullet_amount; i++)
{               
    $('&lt;a id="bullet-'+i+'"&gt;'+i+' &lt;/a&gt;').appendTo('#bullet-nav');

    px_amount = (i-1)*ratio*3450;
    console.log(px_amount);
    $("#bullet-"+i).live('click', function() {
        console.log(px_amount);
    });
}
</code></pre>
