gpt4 book ai didi

javascript - PNotify Confirm Module on Mobile with Modal 模式

转载 作者:行者123 更新时间:2023-11-28 03:46:27 26 4
gpt4 key购买 nike

我正在尝试在移动设备上使用模态确认对话框,但它似乎不起作用。

https://jsfiddle.net/ox0wobsu/11/

引用我的 JSFiddle。如果您缩小页面并刷新以运行,您会发现它不起作用。将部分拉伸(stretch)到足够大,它就会进入视野。

当收缩看起来像这样:enter image description here

希望它看起来像这样... enter image description here

为了使这项工作正常进行,我的示例做错了什么?

这是我的引用代码:

$(document).ready(function(){
PNotify.prototype.options.styling = "bootstrap3";
(new PNotify({
title: 'Confirmation Needed',
text: 'Are you sure?',
icon: 'glyphicon glyphicon-question-sign',
hide: false,
confirm: {
confirm: true
},
buttons: {
closer: false,
sticker: false
},
history: {
history: false
},
addclass: 'stack-modal',
stack: {'dir1':'down','dir2':'right','modal':true}
})).get().on('pnotify.confirm', function() {
alert('Ok, cool.');
}).on('pnotify.cancel', function() {
alert('Oh ok. Chicken, I see.');
});
});

相比之下,这里是一个 JSFiddle,它可以工作,但在非模态模式下。请注意,如果您缩小页面并刷新它看起来是正确的。

https://jsfiddle.net/jrseqvf3/1/

最佳答案

看起来这是 PNotify 中的错误。添加此 CSS 以修复它:

@media (max-width: 480px) {
.ui-pnotify-mobile-able.ui-pnotify.stack-modal {
margin-left: 0;
}
}

关于javascript - PNotify Confirm Module on Mobile with Modal 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43948871/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com