mousemove event inside mousedown

mousemove event inside mousedown

A little question about events.

I have this code to scroll a div with self made scrollbars when the user selects text and gets out of the div.

  1. scrollPane.mousedown(function(){
  2.       scrollPane.off('mousemove').mousemove(scrollOnMove);
  3. });
  4. scrollPane.mouseup(function(){
  5.       scrollPane.off('mousemove');
  6. });

The code works fine.
I'm just not sure if it's good to handle the events like this. Is the mousedown evenet fired only once? If yes it should be no problem. But if the event is fired constantly the mousemove events is removed and set all the time.

Can I leave the code like this or should I change it?