jpillora / notifyjs

Notify.js - A simple, versatile notification library
https://notifyjs.jpillora.com/
MIT License
1.91k stars 740 forks source link

Uncaught Missing style: foo — notify.js:466 #117

Closed bobaikato closed 6 years ago

bobaikato commented 6 years ago

I still can't figure why I'm getting this error. Will you mind supporting me with this?

$.notify({
  title: 'Would you like some Foo ?',
  button: 'Confirm'
}, { 
  style: 'foo',
  autoHide: false,
  clickToHide: false
});
monsterbrain commented 6 years ago

I think you should add this before calling, as given in the site. (Hope it helps someone later).

//add a new style 'foo'
$.notify.addStyle('foo', {
  html: 
    "<div>" +
      "<div class='clearfix'>" +
        "<div class='title' data-notify-html='title'/>" +
        "<div class='buttons'>" +
          "<button class='no'>Cancel</button>" +
          "<button class='yes' data-notify-text='button'></button>" +
        "</div>" +
      "</div>" +
    "</div>"
});