Search code examples
javascriptnotifyjs

notify.js options are not working


I have the following code on my document.ready

$.notify("Your class starts in 15min", "info", {
  clickToHide: false,
  autoHide: false,
  globalPosition: 'top center'
});

but nothing happen, I only get the text and the info type, but autohide and globalposition it's not working.

What I'm doing wrong.

thanks for your helps


Solution

  • I just created a jsFiddle with your given information and everything works fine when you use

    $.notify("Your class starts in 15min", {
      className:'info',
      clickToHide: false,
      autoHide: false,
      globalPosition: 'top right'
    });
    

    The problem was that you used the style information ('info') as the second parameter within the constructor, which actually expects an object of options $.notify( string|object, [ options ]).

    Please note that I used jQuery 2.1.0 and notifyJS v0.3.1.