javascript - Stop mousedown function -


i've got mousedown function. how can stop function when mouse released?

   $('#manrun').mousedown(function(e3) {         var manid = get_id(this);         e3.preventdefault();         $(document).on('mousemove.moveman', function(e2) {            runing(e2, runbtn, manid);         });     }); 

create function mouseup unattach handler.

$('#manrun').on('mouseup', function(e) {     e.preventdefault();     $(document).off('mousemove.moveman'); }); 

Comments