使 froala 编辑器的父级 div 的高度可缩放
Make height of parent div of froala editor scalable
我正在使用 froala 2.4.0 内联编辑器来实现类似 facebook post 的功能。如图所示,我在 div 中嵌入了 froala 编辑器 below.Now 我想让父级 div 可扩展,即随着 froala 编辑器 changes.The 的内容增长/缩小带边框的框是父 div 占位符行是 froala 内联 editor.Is 有什么办法可以做到这一点?
这是我目前得到的:
$(function() {
$('#custom-post-feed-text').froalaEditor({
toolbarInline: true,
charCounterCount: false,
placeholderText: 'Share what\'s on your mind...',
toolbarButtons: [],
quickInsertButtons: []
})
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/froala-editor/2.4.0/css/froala_editor.pkgd.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/froala-editor/2.4.0/js/froala_editor.pkgd.min.js"></script>
<div class="custom-post-feed-container" id="custom-post-feed-container-personal">
<div class="custom-post-feed-textarea">
<textarea id="custom-post-feed-text"></textarea>
</div>
<div class="custom-post-feed-options">
<span class="custom-post-feed-more-options" id="custom-feed-more-options" title="More">+</span>
<span id="more-option">
<span title="Upload image"><i class="fa fa-camera" aria-hidden="true"></i></span>
<span title="Embed link"><i class="fa fa-link" aria-hidden="true"></i></span>
<span title="Upload video"><i class="fa fa-video-camera" aria-hidden="true"></i></span>
<span title="Add Poll"><i class="fa fa-pie-chart" aria-hidden="true"></i></span>
</span>
</div>
</div>
Froala 编辑器支持自动增长功能,您可以在其中设置 heightMin
和 mand
heightMax` 并会随着用户输入自动增长高度。查看文档
https://www.froala.com/wysiwyg-editor/examples/adjustable-height
$(function() {
$('#custom-post-feed-text').froalaEditor({
toolbarInline: true,
charCounterCount: false,
placeholderText: 'Share what\'s on your mind...',
toolbarButtons: [],
quickInsertButtons: []
heightMin: 50,
heightMax: 200
})
});
为了您的目的,如果父 div 没有任何固定高度 custom-post-feed-textarea
它将自动增长
我正在使用 froala 2.4.0 内联编辑器来实现类似 facebook post 的功能。如图所示,我在 div 中嵌入了 froala 编辑器 below.Now 我想让父级 div 可扩展,即随着 froala 编辑器 changes.The 的内容增长/缩小带边框的框是父 div 占位符行是 froala 内联 editor.Is 有什么办法可以做到这一点?
这是我目前得到的:
$(function() {
$('#custom-post-feed-text').froalaEditor({
toolbarInline: true,
charCounterCount: false,
placeholderText: 'Share what\'s on your mind...',
toolbarButtons: [],
quickInsertButtons: []
})
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/froala-editor/2.4.0/css/froala_editor.pkgd.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/froala-editor/2.4.0/js/froala_editor.pkgd.min.js"></script>
<div class="custom-post-feed-container" id="custom-post-feed-container-personal">
<div class="custom-post-feed-textarea">
<textarea id="custom-post-feed-text"></textarea>
</div>
<div class="custom-post-feed-options">
<span class="custom-post-feed-more-options" id="custom-feed-more-options" title="More">+</span>
<span id="more-option">
<span title="Upload image"><i class="fa fa-camera" aria-hidden="true"></i></span>
<span title="Embed link"><i class="fa fa-link" aria-hidden="true"></i></span>
<span title="Upload video"><i class="fa fa-video-camera" aria-hidden="true"></i></span>
<span title="Add Poll"><i class="fa fa-pie-chart" aria-hidden="true"></i></span>
</span>
</div>
</div>
Froala 编辑器支持自动增长功能,您可以在其中设置 heightMin
和 mand
heightMax` 并会随着用户输入自动增长高度。查看文档
https://www.froala.com/wysiwyg-editor/examples/adjustable-height
$(function() {
$('#custom-post-feed-text').froalaEditor({
toolbarInline: true,
charCounterCount: false,
placeholderText: 'Share what\'s on your mind...',
toolbarButtons: [],
quickInsertButtons: []
heightMin: 50,
heightMax: 200
})
});
为了您的目的,如果父 div 没有任何固定高度 custom-post-feed-textarea
它将自动增长