如何将 jquery WYSIWYG 编辑器绑定到 contentEditable div

发布于 2024-10-08 04:55:13 字数 254 浏览 0 评论 0原文

我正在开发一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

反话 2024-10-15 04:55:13

http://www.aloha-editor.org/ 的作用与您所描述的差不多。

http://www.aloha-editor.org/ does pretty much what you're describing.

っ左 2024-10-15 04:55:13

我尝试编写一些用于拖放/调整大小等的函数,并将它们实时绑定到类 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文