Javascript 事件触发(悬停和多次单击)未按调用顺序正常工作
我正在创建一个代码,可以递归地取消facebook上的好友请求 行动流程如下:Javascript 事件触发(悬停和多次单击)未按调用顺序正常工作,javascript,jquery,javascript-events,Javascript,Jquery,Javascript Events,我正在创建一个代码,可以递归地取消facebook上的好友请求 行动流程如下: 好友请求列表 悬停后取消按钮上下文 最终取消请求按钮 我使用以下逻辑执行操作: 注意:我已经将jQuery脚本添加到它的主体中 var offset = 0; $(".FriendRequestOutgoing.enableFriendListFlyout.outgoingButton.enableFriendListFlyout").each(function(){ var xxx=$(this);
var offset = 0;
$(".FriendRequestOutgoing.enableFriendListFlyout.outgoingButton.enableFriendListFlyout").each(function(){
var xxx=$(this);
setTimeout(function(){
xxx.trigger("hover");
setTimeout(function(){
$(".uiMenuItem.FriendListCancel .itemLabel").trigger("click");
setTimeout(function(){
$(".layerConfirm.uiOverlayButton").trigger("click");
},1000);
},1000);
}, 4500 + Math.floor(Math.random()*100)+ offset);
offset += 4500 + Math.floor(Math.random()*100);
});