我正在开发一个应用程序,我想打开一个大模式。
UIkit.modal.confirm('html content', function(){ myFunction() });通过这种方式,它会生成一个默认的模式。
<div class="uk-modal-dialog" style="min-height:0;"><div>但是我想要生成一个宽度为80%的模态或者一个大的模态。举个例子:
<div class="uk-modal-dialog" style="min-height:0; width:80%"><div>我要做什么?
对不起我的英语。
发布于 2022-11-08 00:00:00
在UIKIT版本2中,您可以这样做:
const $modal= UIkit.modal.confirm(COMBINEDMSGTEXT,
function () {
//ur costom code
}, {
labels: {
"Cancel": "Text",
"Ok": "Text"
}
});
//if you console log $modal you will notice you have access to selector and element
const el = $modal.element; // this will return the main selector with the class uk-open
el.children().css("width", "52%"); // the right div you need to target is actually a child element.在UIKIT 3中,只需直接使用模式。$el,您将访问所需的选择器。
https://stackoverflow.com/questions/43537977
复制相似问题