gpt4 book ai didi

javascript - bootbox 的初始化函数在显示对话框后使用一些代码

转载 作者:行者123 更新时间:2023-11-29 16:54:29 25 4
gpt4 key购买 nike

我想显示一个带有引导框的文本区域元素。此文本区域应与 WYSIWYG 编辑器一起使用,它将由

$('#editor').redactor();

所以我想在显示文本区域的那一刻添加它。我试过这个:

bootbox.dialog({
title: "Title",
message: '<textarea id="editor"></textarea>',
init: function () {
$('#editor').redactor();
}
});

但这似乎是错误的。

最佳答案

只需添加一个显示事件:

var box = bootbox.dialog({
title: "Title",
message: '<textarea id="editor"></textarea>'
});
box.bind('shown.bs.modal', function(){
$("#editor").redactor();
});

关于javascript - bootbox 的初始化函数在显示对话框后使用一些代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33362527/

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