javascript 拖动图像以调整位置,如 Facebook 缩略图个人资料图片
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11732935/
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
Drag the image to adjust position like in facebook thumbnail profile picture
提问by Sarawut Positwinyu
In facebook, thumbnail picture will leave out some part of the full picture and we can move that so we can fit the thumbnail picture to fit the preferred position, how to do this using the web technology.
在facebook中,缩略图会遗漏全图的一部分,我们可以移动它,以便我们可以将缩略图适合首选位置,如何使用网络技术来做到这一点。
In the example, we can drag the image to move the position of thumbnail.
在示例中,我们可以拖动图像来移动缩略图的位置。
采纳答案by Jarrod
You could try something like this jquery plugin. It's not identical to Facebook but provides controlled crop functionality.
你可以试试这个jquery plugin 之类的东西。它与 Facebook 不同,但提供受控裁剪功能。
Otherwise, the question has been answered here: Is there a jQuery image cropping plugin similar to Facebook's image crop?
否则,这里已经回答了问题:是否有类似于 Facebook 图像裁剪的 jQuery 图像裁剪插件?
EDIT: Try this one: imgareaselect.
编辑:试试这个:imgareaselect。
回答by Ergec
I've been looking for an exact same kind of plugin, couldn't find one, so I wrote one :). Check it out. It's very basic and not many capabilities but still usefull. Use it well, spread it, credit me too ;)
我一直在寻找一种完全相同的插件,找不到,所以我写了一个:)。看看这个。它非常基础,功能不多,但仍然很有用。好好使用它,传播它,也请相信我 ;)
.
Edit: 22 Dec 2013
编辑:2013 年 12 月 22 日
I noticed that the version using percentages was not working as expected. Link is updated now.
我注意到使用百分比的版本没有按预期工作。链接现已更新。
I aslo added an X-Axis version
我还添加了 X 轴版本
回答by Jarrod
This is exactly what you need: http://github.com/matiasgagliano/guillotine
这正是您所需要的:http: //github.com/matiasgagliano/guillotine
Plus it supports zoom, rotation, touch devises and it's fully responsive.
此外,它还支持缩放、旋转、触摸设备,并且完全响应。