Webkit:实时图像在内容可编辑容器中调整大小
我试图在 Chrome 的 contenteditor div 中拥有可调整大小的图像,就像 Firefox 那样。 当您单击图像时,应该会出现调整大小处理程序。 我尝试了 jQuery UI 可调整大小插件,但当您移动(拖放)容器内的图像时,它会损坏。 还尝试了 CSS3 resize 属性,但它仅适用于块元素,不适用于 有什么建议吗? 谢谢
I'm trying to have the ability to have resizable images in a contenteditor div in Chrome, like Firefox does.
When you click on an image, the resize handlers should appear.
I tried the jQuery UI resizable plugin, but it becomes broken when you move (drag and drop) the images inside the container.
Also tried the CSS3 resize property, but it only applies to block elements, not
Any suggestion?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,WebKit 不支持在可编辑元素中调整图像和表格的大小。
既然如此,您将不得不使用其他一些方法,例如向可编辑元素添加单击事件处理程序,并在图像周围绘制缩放器元素(如果单击了)。由于大型编辑器(TinyMCE 和 CKEditor)还没有实现它,我认为这会很复杂。
WebKit has no support for resizing images and tables within editable elements, unfortunately.
That being the case, you're going to have to use some other means, such adding a click event handler to the editable element and drawing resizer elements around the image, if one was clicked. Seeing as the big editors (TinyMCE and CKEditor) haven't implemented it, I assume there are complications.
WebKit 不支持调整图像和表格的大小。不过,可以通过使用 JavaScript 实现调整大小功能来解决此问题。使用 javascript 操作图像和可编辑 iframe 中的图像没有太大区别。有一个开源 jquery 插件正在实现此 http://www.editorboost.net/webkitresize 该插件还支持表格单元格调整大小。
WebKit doesn’t support resizing images and tables. However it is possible to fix this by implementing resize functionality by using javascript. There is no big difference between manipulating with javascript an image and an image in an editable iframe. There is an open source jquery plugin that is implementing this http://www.editorboost.net/webkitresize This plugin also supports table cell resize.