如何设置pnotify的顶部中心位置

Tar*_*ets 0 position pnotify

如何设置非像素位置?我试试这个

var stack = { "dir1": "down", "dir2": "right", "firstpos1": 50, "firstpos2": 50 };
Run Code Online (Sandbox Code Playgroud)

但我认为这是不好的,因为屏幕分辨率不同.

aka*_*kin 9

Necroposting,但可能有助于其他搜索者.我没有js重新计算的解决方案:

JS:

new PNotify({
    ...
    addclass: 'pnotify-center'
});
Run Code Online (Sandbox Code Playgroud)

CSS:

.pnotify-center {
   right: calc(50% - 150px) !important;
}
Run Code Online (Sandbox Code Playgroud)