summernote - 如何让 SummerNote 编辑器覆盖图像
问题描述
我正在 mvc 中创建一个应用程序并使用 Summernote Editor。我需要我的 Summernote 编辑器来覆盖类似于他们在 Summernote 登录页面上的图像 - https://summernote.org/
<script type="text/javascript">
$(function () {
// main summernote with custom placeholder
var $placeholder = $('.placeholder');
$('#summernote').summernote({
height: 50,
toolbar: [],
codemirror: {
mode: 'text/html',
htmlMode: true,
lineNumbers: true,
theme: 'monokai'
},
callbacks: {
onInit: function () {
$placeholder.show();
},
onFocus: function () {
$placeholder.hide();
},
onBlur: function () {
var $self = $(this);
setTimeout(function () {
if ($self.summernote('isEmpty') && !$self.summernote('codeview.isActivated')) {
$placeholder.show();
}
}, 100);
}
}
});
});
</script>
@section Scripts
{
<script src="~/Scripts/summernote.min.js" type="text/javascript"></script>
<link href="~/Content/summernote.min.css" rel="stylesheet" />
}
<div class="note-editor">
<img src="@Url.Content("~/css/Images/Home.jpg")" alt="logo" style="width: 100%; top: 50px;"/>
<div id="summernote" class="note-editor.note-airframe">
<p><br></p>
</div>
</div>
解决方案
推荐阅读
- html - 列内容垂直对齐 - Bootstrap 4
- reactjs - React 组件中 prop 参数的动态泛型
- c++ - Qt如何改成C++17
- google-data-studio - 数据工作室 | 日期过滤器 | 比今天更伟大
- r - s3.将 json 文件保存到 aws s3
- mysql - MYSQL - 在多个条件下左连接 - 媒体和标签和标签链接
- pandas - 在 Pandas 中,print() 和 display() 如何呈现完全不同的数字?
- powerbi - 如何根据选定的筛选器动态更改 Power BI DAX 中的筛选器
- javascript - 鉴于此 MLB 算法,我如何预测获胜者?
- php - 由于friendsofsymfony/user-bundle,安装symfony/mailer失败