Article From:https://segmentfault.com/q/1010000012136081
Question:
$(document).on('mousedown', function(e) {
        var mousedown = {
            x: e.pageX
        }
        $(document).on('mousemove', function(e) {
            var mousemove = {
                x: e.pageX
            }
        })
    })

    $(document).on('mouseup', function(){
        $(document).off();
    })

Answer 0:

Binding is an anonymous function. You can pass a non anonymous function when you bind it. Once you unbind it, you can bind it again.

Answer 1:

$(document).on(‘mouseup’, function(){

    $(document).off('mousemove');
})

Answer 2:
off() 

Leave a Reply

Your email address will not be published. Required fields are marked *