首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >定制uikit.modal

定制uikit.modal
EN

Stack Overflow用户
提问于 2017-04-21 08:44:37
回答 1查看 2.7K关注 0票数 2

我正在开发一个应用程序,我想打开一个大模式。

代码语言:javascript
复制
UIkit.modal.confirm('html content', function(){ myFunction() });

通过这种方式,它会生成一个默认的模式。

代码语言:javascript
复制
<div class="uk-modal-dialog" style="min-height:0;"><div>

但是我想要生成一个宽度为80%的模态或者一个大的模态。举个例子:

代码语言:javascript
复制
<div class="uk-modal-dialog" style="min-height:0; width:80%"><div>

我要做什么?

对不起我的英语。

EN

回答 1

Stack Overflow用户

发布于 2022-11-08 00:00:00

在UIKIT版本2中,您可以这样做:

代码语言:javascript
复制
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,您将访问所需的选择器。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43537977

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档