Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

图片描述

当我连续点击按钮的时候它会创建多个,我需要让它只显示一个,等全部消失后才能继续点击?
请问可以做吗?
谢谢!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
390 views
Welcome To Ask or Share your Answers For Others

1 Answer

在点下按钮的时候,先将按钮设置disabled,然后在关闭回调函数中取消disabled,保证关闭后按钮继续可用,代码如下

$.notify({
    // options 配置你的提示信息
    icon: '',
    title: '',
    message: '',
    url: '',
    target: '_blank'
},{
    // settings 关于notify的设置
    onClosed: function() {
                // 这里讲你的按钮置为可用
              },
});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...