How do I replace an event handler with jQuery?

前端 未结 3 1068
星月不相逢
星月不相逢 2020-12-21 06:29

I have a site that uses AJAX to navigate. I have two pages that I use a click and drag feature using

$(\".myDragArea\").mousedown(function(){
  do stuff...
         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-21 06:55

    Calling $("body").mouseup(function) will add an event handler.
    You need to remove the existing handler by writing $("body").unbind('mouseup');.

提交回复
热议问题