0

我已经从站点复制了确切的 PNotify 提示代码:(https://sciactive.com/pnotify/):

$("#show-pnotify").on('click', function() {
    var x = new PNotify({
        title: 'Password Required',
        text: 'Enter Password',
        icon: 'glyphicon glyphicon-lock',
        styling: 'bootstrap3',
        hide: true,
        addclass: 'stack-modal',
        confirm: {
            prompt: true
        },
        buttons: {
            closer: false,
            sticker: false
        },
        history: {
            history: false
        }
    })
});

它适用于他们的网站,它适用于 Fiddle ( http://jsfiddle.net/gusLfnux/2/ ),但它没有在我的 Concrete5 网站上正确显示 - 它显示带有标题和文本的提示,但没有文本输入,没有显示任何按钮。这是为什么?它适用于其他任何地方。

4

1 回答 1

0

如果没有其他事情要做,我最好的猜测是您在某处缺少导入语句。Concrete5 不包含PNotify 的所有内容。例如,我在 Bootstrap 中使用模态,我必须包含指向完整 bootstrap.min.js 的链接。下载缩小的PNotify JS,并尝试将以下导入语句添加到您的标题中(当然,使用正确的路线):

<script type="text/javascript" src="pnotify.custom.min.js"></script>
<link href="pnotify.custom.min.css" media="all" rel="stylesheet" type="text/css" />

到你的标题,看看是否能解决它。

Concrete5 从一堆不同的东西中借用元素,但不是从一个东西中借用所有东西。他们提供了ConcreteAlert,但我无法让它发挥得很好。

于 2018-09-06T21:07:33.387 回答