我正在使用 jQuery Growl 插件在我的网站上向我的用户通知消息, 我的消息 displayTimeout 是 3500,我的问题是一些通知消息需要在 displayTimeout 之后消失,但有些需要保持静态直到我将它们删除。 我的问题是如何让我的通知保持不变而不消失? 谢谢
最佳答案
这个循环负责显示和淡出..你可以编辑代码..
Growl.prototype.cycle = function() {
var $growl;
$growl = this.$growl();
console.log(this.settings.duration);
return enter code here$growl.queue(this.present).delay(this.settings.duration).queue(this.dismiss).queue(this.remove);
};
让它变成这样..
Growl.prototype.cycle = function() {
var $growl;
$growl = this.$growl();
console.log(this.settings.duration);
if(this.settings.duration==0){
return $growl.queue(this.present);
}else{
return $growl.queue(this.present).delay(this.settings.duration).queue(this.dismiss).queue(this.remove);
}
};
所以如果你像这样初始化..
$.growl({
title: "Saving",
style: "primary",
message: 'Please wait...',
duration: 0
});
它不会淡出..你可能想使用“dismiss”手动淡出它
关于javascript - 使 jQuery Growl 插件消息不会淡出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12563433/