copy, drag & drop bug : item stops moving
<p>I'm trying to drag and drop items on a page, but insteads of moving the item itself, I create a copy of it.</p>

<p>Here is my code. "copyDragDrop" is a div at the bottom of the page. It remains empty until the user strats dragging something.</p>

<pre><code>function coordSouris()
{
 return {
  x:event.clientX + document.body.scrollLeft - document.body.clientLeft,
  y:event.clientY + document.body.scrollTop  - document.body.clientTop
    };
}

function drag()
{
    var pos = coordSouris(event);
    copie = event.srcElement.cloneNode(true);
    document.getElementById('copieDragDrop').appendChild(copie);
    copie.style.position = 'absolute';
    copie.style.display = 'block';

    document.onmousemove = mouseMove;
    document.onmouseup = drop;
}


function mouseMove()
{
    if (copie != null)
    {
        var pos = coordSouris(event);
        copie.style.left = pos.x;
        copie.style.top = pos.y;
    }
}

function drop()
{
    var divCopie = document.getElementById('copieDragDrop');
    if (divCopie.hasChildNodes() )
    {
        while ( divCopie.childNodes.length &gt;= 1 )
        {
            divCopie.removeChild(divCopie.firstChild);       
        } 
    }
}
</code></pre>

<p>This code creates the copy, starts to move it, but after a few pixels, the copy stops following the mouse. If I release the mouse, "onmouseup" is not fired, but the copy starts to follow the mouse again ! I've tried the code on several items, the same bug occurs</p>

<p>I don't understand anything, any help is more than welcome.</p>

<p><strong>UPDATE :</strong> I juste realised that all elements I tried the code on had something in common : they contained or were included in an ASP.net hyperlink control. The same code works well on regular HTML elements. There must be some auto-generated javascript for links that interferes with my code.</p>
