sciactive / pnotify

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

Options ignored #284

Closed sasoriza closed 6 years ago

sasoriza commented 7 years ago

I can't get some of the options to work and I am clueless as to why. This is my code and neither the nonblock nor the desktop option is working.

<script type="text/javascript">
    $j(document).ready(function(){
        var stack_topRight = {"dir1": "down", "dir2": "right", "push": "top"};
        var opts = {
            insert_brs: false,
            animate_speed: "fast",
            stack: stack_topRight,
            buttons: {
              closer_hover: false,
              sticker: false
            },
            nonblock: {
                nonblock: true,
                nonblock_opacity: .8
            },
            desktop: {
              desktop: true
            }
        };
        $j('ul.messages>li').each(function() {
          opts.type = $j(this).hasClass('error-msg') ? 'error' : 'success' ;
          opts.icon = opts.type == 'error' ? 'fa fa-exclamation-triangle' : 'fa fa-check-circle-o';
          opts.text = $j(this).text();
          new PNotify(opts);
        });
    });
</script>
djmattyg007 commented 7 years ago

Do you have the desktop and nonblock modules on the page? They're optional features shipped as part of extra javascript files.

hperrin commented 6 years ago

I'm assuming you got it working. Be sure to include all the modules' JS/CSS files that you're using.