10368 发表于 2024-4-10 10:45:03

按钮 在点击按钮时瞬间点了两次 执行了两次 重复执行了

如何短时间内不重复执行   代码怎么写

比如5秒内点击多次只执行一次

论坛管理员 发表于 2024-4-12 10:46:49

在click事件里增加,点击后加disable属性

10368 发表于 2024-7-24 15:34:38

论坛管理员 发表于 2024-4-12 10:46
在click事件里增加,点击后加disable属性


弹窗 确认按钮 "text": "确定",如何只执行一次   代码要怎么修改
var dialog = o2.DL.open({
"style" : "o2",
"title": "弹出框标题",
"width": "400",
"height" : "200",
"isMax": false,
"isClose": true,
"isResize": true,
"isMove": true,
"isTitle": true,
"offset": {"x":-200, "y": -100},
"mask": true,
"content": new Element("div"),
"container": this.form.getApp().content,
"duration": 200,
"buttonList": [
    {
      "text": "确定",
      "action": function(){
          var result = {"key":"value"};
          if (callback) callback.apply(this, );
          dialog.close();
      }.bind(this)
    },
    {
      "text": "取消",
      "action": function(){
      
页: [1]
查看完整版本: 按钮 在点击按钮时瞬间点了两次 执行了两次 重复执行了