sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 513 forks source link

animate & attention seeker effects dont work together #226

Closed ggelashvili closed 6 years ago

ggelashvili commented 8 years ago

My notification should show up with bounceInDown effect and when hiding should hide with bounceOutUp effect. This all works perfect but if I also want my notification at some point while its visible to bounce or perform any of the attention seeker effects, those effects dont trigger. If I comment out the animate part, then attention seekers work. Here is my code:

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
    },
});

Then I have an interval of 15 seconds, it needs to perform any of the attention seeker effects:

setInterval(function() {
    // if animate above is commented out, this works, otherwise
    // this does not work
    notification.attention('jello');
}, 15000);

Please help.