如何将 jquery WYSIWYG 编辑器绑定到 contentEditable div
我正在开发一个CMS,目前正在实现一种编辑页面内容的方法。目前,我有一个 div 保存可编辑部分,当选择该部分进行编辑时,会使 div contentEditable = true
。然后可以通过 ajax 请求保存它。这一切都很好用。
但现在我需要一种将所见即所得编辑器(首选 jquery 兼容)绑定到可编辑 div 的方法。另外,为了使事情复杂化,我需要将所见即所得编辑器工具栏放在单独的块中;这可能是一个浮动工具栏,当有人编辑某个部分时会出现。
I'm developing a cms and I'm currently implementing a way of editing pages content. At the moment I have a div holding the editable sections which when selected for editing make the div contentEditable = true
. This can then be saved via an ajax request. Which all works nicely.
But now I need a method of binding a wysiwyg editor (pref jquery compatible) to the editable div. Also to complicate things I need the wysiwyg editor toolbar to be in a separate block; which is likely to be a floating toolbar that appears when someone edits a section.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://www.aloha-editor.org/ 的作用与您所描述的差不多。
http://www.aloha-editor.org/ does pretty much what you're describing.
我尝试编写一些用于拖放/调整大小等的函数,并将它们实时绑定到类
editable
的所有子级。这将需要做一些工作,但这是我现在看到的唯一解决方案。What I'd try is to write some functions for drag and drop / resize and so on and live bind them to all children of class
editable
. It would be some work to do, but it's the only solution I see now.