CKEditor 5改变高度事件

只需明确定义时间的输入类型就可以了


$('#Tools input[type=time]').timepicker({

   timeFormat: 'HH:mm',

   interval: 30,

   use24hours: true,

   scrollbar: true,

});

但这不起作用...

您对如何修复它有什么想法吗?

感谢您抽出宝贵的时间,祝您有美好的一天:)


繁星淼淼
浏览 50回答 1
1回答

偶然的你

您可以检查事件内的编辑器高度change,看看高度是否发生变化。请运行以下代码片段并检查控制台:let editorWidth;let editorHeight;ClassicEditor&nbsp; .create(document.querySelector('#Comment'), {&nbsp; &nbsp; toolbar: [ 'heading', '|', 'bold', 'italic', 'blockQuote' ],&nbsp; })&nbsp; .then(editor => {&nbsp; &nbsp; editor.model.document.on('change', (eventInfo, name, value, oldValue) => {&nbsp; &nbsp; &nbsp; &nbsp; const newWidth = editor.ui.view.element.offsetWidth;&nbsp; &nbsp; &nbsp; &nbsp; const newHeight = editor.ui.view.element.offsetHeight;&nbsp; &nbsp; &nbsp; &nbsp; if(editorWidth !== newWidth || editorHeight !== newHeight) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log('Editor size changed. New size:', newWidth, newHeight);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; editorWidth = newWidth;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; editorHeight = newHeight;&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; });&nbsp; })&nbsp; .catch(error => {&nbsp; &nbsp; &nbsp; console.error(error);&nbsp; });<script src="https://cdn.ckeditor.com/ckeditor5/17.0.0/classic/ckeditor.js"></script><div id="Comment"></div>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5