这是一个理论问题......我有两个mouseUp事件。其中一个是从我正在使用的其他人开发的外部jQuery插件中解雇的,这个事件以这种方式绑定:
//Add Events for mouse drag / touch swipe action
$(document).bind(self.event_up + self.id, { self: self }, self.mouseUp);
另一个鼠标注册事件,它是由我使用标准代码解雇的,如下所示:
$(document).mouseup(function (e) {
}
});
我的问题很简单,有时一个事件在另一个事件之前触发,有时另一个事件在另一个事件之前触发。
如果我有任何选项以某种顺序绑定mouseUp事件,有人可以解释一下吗?
答案 0 :(得分:0)
$(document).unbind('mouseup');
$(document).bind(
"mouseup",
function( event ){
event.stopPropagation();
$.externalFunction(event);
yourFunction(event)
}
);
这就是你需要的。