这是个理论问题..。我有两个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事件吗?
发布于 2014-10-07 08:31:59
$(document).unbind('mouseup');
$(document).bind(
"mouseup",
function( event ){
event.stopPropagation();
$.externalFunction(event);
yourFunction(event)
}
);这就是你所需要的。
https://stackoverflow.com/questions/26230756
复制相似问题