这是小提琴:小提琴
注释掉该animate: {}
部分,然后单击按钮以查看没有它的“jello”动画是否有效,初始加载动画有效但 jello 无效。
我正在使用PNotify插件。这是我的设置:
PNotify.prototype.options.styling = "jqueryui";
var myStack = {"dir1":"down", "dir2":"left", "push":"top"};
var notification = new PNotify({
title: "Test Title",
text: "Test Content",
stack: myStack,
icon: 'glyphicon glyphicon-info-sign',
type: 'info',
// IF I COMMENT THIS OUT, THE "jello" effect works fine but then
// when showing/hiding the notification it does not use the bellow effects
animate: {
animate: true,
in_class: 'bounceInDown',
out_class: 'bounceOutUp'
},
buttons: {
sticker: false,
closer_hover: false
},
mobile: {
swipe_dismiss: true,
styling: true
},
nonblock: {
nonblock: false,
nonblock_opacity: .2
},
});
然后我在按钮上有一个点击事件来激活“果冻”效果:
$('#clickMeButton').on('click', function() {
// if animate above is commented out, this works, otherwise
// this does not work
notification.attention('jello');
});
我需要这两种效果才能工作,当通知显示时它必须以该效果反弹,当点击它必须做“果冻”效果时,当隐藏/关闭它时它必须做反弹效果。