Problem resizing manually width with the mouse

Problem resizing manually width with the mouse

I have a div, i want to resize it with the mouse clicking the right-border. 
I don't want to use jQuery-UI.
So i write my plugin but the function doesn't work.
The code is:
  1. resizeWidth: function(){
  2.       var coord=null;
  3.       $(this).mousedown(function(e){
  4.             coord={
  5.                   x: e.pageX,
  6.                    dw: $(this).parent("#uz").width(),
  7.             tw: $(this).parent("uz").children("textarea").width()
  8.       };
  9.       e.preventDefault();
  10. });
  11. $(document).mousemove(function(e){
  12. if (coord){
  13. // alert(coord.tw);
  14. $(this).parent("#uz").children("textarea").css("width",coord.tw+(e.pageX-coord.x));
  15. $(this).parent("#uz").css("width",coord.dw+(e.pageX-coord.x));
  16. }
  17. e.preventDefault();
  18. }).mouseup(function(e){
  19. coord=null;
  20. e.preventDefault();
  21. });
  22. }
If i uncomment the alert in mousemove handler, i see that the mouseup event is never fired, so there is an alert every movemenet of the mouse.

Using DOMInspector of Chrome there aren't error.

Some help?