如何在此函数中添加处理时间

how to add processing time in this function

本文关键字:添加 处理 时间 函数      更新时间:2023-09-26
 $(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#revocation" ).dialog({
  autoOpen: false,
  height: 200,
  width: 460,
  modal: true,
  buttons:{
    "Yes": function() {
      revocation();
    },
    "Close" : function() {
      $( this ).dialog( "close" );
    }
  }
});

我想在此功能中添加处理时间,当我单击"是"按钮时,添加处理时间为3-5秒,提前感谢您

Javascript 是 asynchronyous 语言。你可以把

setTimeout(function() {revocation();},3000);

而不是

revocation();

延迟 3000 毫秒

你看到我的图片更多,可以添加功能,当我点击按钮"是"时,在Chrome中出现2个文件"撤销",延迟时间:410ms和309ms,有一种方法可以添加jquery使一键按钮2文件运行等于不,例如:410ms和410ms。

图像