NOTY is a notification library that makes it easy to create alert - success - error - warning - information - confirmation messages as an alternative the standard alert dialog.

GitHub release Bower version npm version Packagist version devDependency Status npm Contributors

Need help for Documentation & Translation Details are here.
v2.* documentation is here.

Show & Hide Animations with velocity.js

Get velocity, first.


new Noty({
    ...
    text: 'NOTY - animating with velocity!',
    ...
    animation: {
        open: function (promise) {
            var n = this;
            Velocity(n.barDom, {
                left: 450,
                scaleY: 2
            }, {
                duration: 0
            });
            Velocity(n.barDom, {
                left: 0,
                scaleY: 1
            }, {
                easing: [ 8, 8 ],
                complete: function() {
                    promise(function(resolve) {
                        resolve();
                    })
                }
            });
        },
        close: function (promise) {
            var n = this;
            Velocity(n.barDom, {
                left: '+=-50'
            }, {
                easing: [ 8, 8, 2],
                duration: 350
            });
            Velocity(n.barDom, {
                left: 450,
                scaleY: .2,
                height: 0,
                margin: 0
            }, {
                easing: [ 8, 8 ],
                complete: function () {
                    promise(function(resolve) {
                        resolve();
                    })
                }
            });
        }
    }
}).show();
Important: You need to resolve promises for this type of usage.