my jQuery script is not working with images, but working with all other elements
<p>I have created a jQuery script to drag elements over the document. I done the script and is working perfectly. but when I add an image the script fails. Why I cant drag an image over my document, I can drag other elements such as div, span etc . I am not interested to use jQuery UI for this purpose</p>

<p>my code follows</p>

<pre><code>&lt;script language="javascript" src="jquery-1.4.2.min.js"&gt;&lt;/script&gt;
&lt;script language="javascript"&gt;
  var x1 = y1 = 0;
  var drag = false;
  $(document).ready(function(e){
    $('#dv').mousedown(function(e){ 
      x1 = e.pageX - parseInt($('#dv').css('left'));
      y1 = e.pageY - parseInt($('#dv').css('top'));
      drag = true; 
    })
    $(document).mouseup(function(e){ drag = false; })
    $(document).mousemove(function(e){ 
      if(!drag) return
      $('#dv').css('left',eval(e.pageX - x1)+'px')
      $('#dv').css('top',eval(e.pageY - y1)+'px')
    })
  });
&lt;/script&gt;
</code></pre>

<p>please check this <a href="http://olario.com/jquery/first.php" rel="nofollow">olario.com/jquery/first.php</a> ( a normal div with text) working perfectly </p>

<p>second <a href="http://olario.com/jquery/second.php" rel="nofollow">olario.com/jquery/second.php</a>, that doesn't work with image </p>

<p>I spent two weeks to fix this issue, hope this forum will help me</p>

<p>Thanks a lot in advance</p>
