notifyjs 消失无隐藏效果
notifyjs disappears without hide effect
我有一个带有 notifyjs jQuery 插件的通知。
var notifyProps = {};
notifyProps.showAnimation = 'slideDown';
notifyProps.showDuration = 2500;
notifyProps.hideAnimation = 'slideUp';
notifyProps.hideDuration = 2500;
notifyProps.style = 'myStyle';
notifyProps.clickToHide = true;
var insertId = ("myId"+ Math.random()).replace('0\.',''); //just an id
$.notify({title: $('<div id="'+insertId+'"></div>').append(elem.element)},notifyProps);
如果fadeOut
设置为hideAnimation
,通知会随着slideDown的showAnimation正确显示,但是点击时,它只是消失而不是向上滑动,或者淡出。
我正在使用 addStyle 来定义 myStyle
,如下所示:
$notify.addStyle("myStyle", {
html:
"<div>" +
"<div class='clearfix'>" +
"<div class='lb-close'></div>" +
"<div class='notify-title' data-notify-html='title'/>" +
"</div>" +
"</div>",
css: "-webkit-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);-moz-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);"
});
调试这个,通知的show()
方法被调用false
作为参数,但是当它到达这个函数的最后一行时:
return elems[fn].apply(elems, args);
通知div只是立即消失,而不是转出。我还能检查什么?
就是因为这几行,在Notification.prototype.show
:
callback = function() {
if (!show && !_this.elem) {
_this.destroy();
}
if (userCallback) {
return userCallback();
}
};
出于某种原因,_this.elem
始终未定义,我猜这反过来会破坏通知元素。我只是评论检查回调,一切似乎都很好。
我有一个带有 notifyjs jQuery 插件的通知。
var notifyProps = {};
notifyProps.showAnimation = 'slideDown';
notifyProps.showDuration = 2500;
notifyProps.hideAnimation = 'slideUp';
notifyProps.hideDuration = 2500;
notifyProps.style = 'myStyle';
notifyProps.clickToHide = true;
var insertId = ("myId"+ Math.random()).replace('0\.',''); //just an id
$.notify({title: $('<div id="'+insertId+'"></div>').append(elem.element)},notifyProps);
如果fadeOut
设置为hideAnimation
,通知会随着slideDown的showAnimation正确显示,但是点击时,它只是消失而不是向上滑动,或者淡出。
我正在使用 addStyle 来定义 myStyle
,如下所示:
$notify.addStyle("myStyle", {
html:
"<div>" +
"<div class='clearfix'>" +
"<div class='lb-close'></div>" +
"<div class='notify-title' data-notify-html='title'/>" +
"</div>" +
"</div>",
css: "-webkit-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);-moz-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);"
});
调试这个,通知的show()
方法被调用false
作为参数,但是当它到达这个函数的最后一行时:
return elems[fn].apply(elems, args);
通知div只是立即消失,而不是转出。我还能检查什么?
就是因为这几行,在Notification.prototype.show
:
callback = function() {
if (!show && !_this.elem) {
_this.destroy();
}
if (userCallback) {
return userCallback();
}
};
出于某种原因,_this.elem
始终未定义,我猜这反过来会破坏通知元素。我只是评论检查回调,一切似乎都很好。