Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 事件触发(悬停和多次单击)未按调用顺序正常工作_Javascript_Jquery_Javascript Events - Fatal编程技术网

Javascript 事件触发(悬停和多次单击)未按调用顺序正常工作

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

我正在创建一个代码,可以递归地取消facebook上的好友请求

行动流程如下:

  • 好友请求列表
  • 悬停后取消按钮上下文
  • 最终取消请求按钮
  • 我使用以下逻辑执行操作:

    注意:我已经将jQuery脚本添加到它的主体中

    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);
    });