sciactive / pnotify

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

PNotify.defaultStack not work #327

Open mahdisky opened 6 years ago

mahdisky commented 6 years ago

how to set default PNotify.defaultStack? i did this but didnt get any result

hperrin commented 6 years ago

What version are you using?

mahdisky commented 6 years ago

v4

hperrin commented 6 years ago

Can you show me your code? I'm not sure what you're trying to do.

mahdisky commented 6 years ago

PNotify.defaultStack = { "dir1": "down", "dir2": "left", "firstpos1": 25, "firstpos2": 25, "spacing1": 36, "spacing2": 36, "push": "top", // "context": document.body };

hperrin commented 6 years ago

As long as it's not on one line like that (so the comment doesn't comment out the closing }, that should work. Are you running it after loading PNotify?

mahdisky commented 6 years ago

yes,can you send sample of this ?that's the position in top left and a little bit down

hperrin commented 6 years ago

Try it like this:

document.addEventListener('DOMContentLoaded', function() {
  PNotify.defaultStack = { "dir1": "down", "dir2": "left", "firstpos1": 25, "firstpos2": 25, "spacing1": 36, "spacing2": 36, "push": "top", "context": document.body };
});