带图像的 RichTextEditor
我需要放入一个富文本编辑器,它应该能够插入图片,并且我的用户需要控制将图像放置在编辑器中任何位置的位置,而不损坏已输入的文本。如果用户至少可以移动就可以了编辑器周围的图像。谁能帮我,举个例子吗?
任何帮助都会很棒..
非常感谢
I need to put in a Rich Text Editor which should be able to insert a picture and my user needs to control the position of placing the image anywhere in the editor without damaging the text already entered.It will be okay if user can at least move the image around the editor. Can anyone help me, have some example?
Any help would be great..
many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下代码轻松地在 RichTextEditor 中输入图像,
但是移动图像可能会出现问题。
通过上述,可以通过将包装的文本图像放置在 RTE 内的不同位置来上下移动图像,但如果您想给予绝对控制,我建议创建一个新的图像对象,具有绝对布局并允许用户来移动它。
但这需要编写大量代码,以创建隐藏图像、显示部分图像的逻辑,当发生滚动且图像不应显示在屏幕上时。
You can easily enter images in a RichTextEditor with the following code
But moving the image around , is something which might be problematic.
With the above , it might be possible to move the image up and down by placing the wrapped text image at different positions inside the RTE, but incase you want to give absolute control , Id suggest creating a new image object, with absolute layout and allow user to move it around.
But that would involve writing a lot of code , to create the logic of hiding the image, showing part of the image, when a scroll happens and the image is not supposed to be shown on the screen.