Passing variables in event listener not working
<p>I have a simple event listener and I am trying to pass variables to a function but it's not working... this is what I have:</p>

<pre><code>window.onload = function () {
    document.getElementById('cursor').addEventListener("mousedown", mousePos, false);
}

function mousePos(e) {
    var x = e.clientX;
    var y = e.clientY;
    document.getElementById('cursor').addEventListener("mousemove", function () {
        mousemoveCalc(x, y);
    }, false);
}

function mousemoveCalc(e, x, y) {
    console.log(e);
    console.log(x); //undefined
    console.log(y); //undefined
}
</code></pre>

<p>I'm getting undefined for <code>x</code> and <code>y</code> but I do not know how to solve it =/ They are not undefined however in mousePos =/</p>

<p>How do i fix this ?</p>
