Javascript JS/jQuery 图像编辑器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2247712/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JS/jQuery Image Editor
提问by Adam Kiss
has anyone stumbled upon image editor done either in pure JS, or jQuery - that kind like CKEditor has?
有没有人偶然发现用纯 JS 或 jQuery 完成的图像编辑器 - 像 CKEditor 那样?
I'm looking for piece of code, that adds handles to image, so you can resize it, or even drag image around, as you wish.
我正在寻找一段代码,为图像添加句柄,因此您可以根据需要调整其大小,甚至拖动图像。
Thank you.
谢谢你。
Edit: rephrased.
编辑:改写。
采纳答案by Anonymous
Here is wonderful image crop/resize JQuery plugin http://www.cropzoom.com.ar/
这是精彩的图像裁剪/调整 JQuery 插件http://www.cropzoom.com.ar/
回答by Teja Kantamneni
回答by meouw
The way editors such as tinyMCE and CKEditor do it is like this
tinyMCE和CKEditor等编辑器的做法是这样的
<div contenteditable="true" id="div1">
<img src="tache17.jpg" />
</div>
<a href="javascript:alert(document.getElementById('div1').innerHTML)">gimme html</a>
It's a browser thing not a JS thing.
Of course placing the image in the div and making the div contentEditable is done with JS but the resizing handles you are talking about are generated by the browser.
NoteI haven't tested this in anything other than firefox
这是浏览器的事情而不是 JS 的事情。当然,将图像放入 div 并使 div contentEditable 是使用 JS 完成的,但是您正在谈论的调整大小手柄是由浏览器生成的。
注意我没有在 Firefox 以外的任何东西中测试过这个
回答by Benoit
if you are looking for croopzoom and the website don't work? look at github -> https://github.com/cropzoom/cropzoom
如果您正在寻找 croopzoom 并且该网站不起作用?看 github -> https://github.com/cropzoom/cropzoom

