Move a div with mouse position

Move a div with mouse position

Hi,

Here is my testpage's url :
http://www.itch.fr/test/

I wrote this little code in order to move a div into another one, with mouse position. But my code works only when mouse is moving, as I want it to make the move continue when the mouse is to the left or to the right of the middle of the user's window.
Here is the code :
  1. $(document).ready(function(){
  2.     //Taille du div container
  3.     divwidth  = $("#book_container").width();
  4.     milieu = divwidth/2;
  5.     positionX=0;
  6.     pixels=0;
  7.     css=0;
  8.    
  9.     $().mousemove(function(f){
  10.         positionX = f.pageX;
  11.        
  12.         if (positionX<milieu){
  13.             difference = milieu - positionX;
  14.             ratio = difference/milieu;
  15.             pixels = ratio*10;
  16.         } else {
  17.             difference = positionX - milieu;
  18.             ratio = difference/milieu;
  19.             pixels = -ratio*10;
  20.         }
  21.        
  22.         $('#ma-zone').html("positionX : "+positionX+"<br>milieu : "+milieu+"<br>difference : "+difference+"<br>ratio : "+ratio+"<br>pixels : "+pixels+"<BR>css : "+css+"<BR>");
  23.     css=parseInt($('#book_elements').css('left'));
  24.     pixels=css*1+pixels*1;
  25.     $("#book_elements").css("left",pixels);
  26.     });
  27. });

Thx for your help...