Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag the image to adjust position like in facebook thumbnail profile picture

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.

enter image description here

In the example, we can drag the image to move the position of thumbnail.

like image 279
Sarawut Positwinyu Avatar asked Jul 31 '12 04:07

Sarawut Positwinyu


2 Answers

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

I noticed that the version using percentages was not working as expected. Link is updated now.

I aslo added an X-Axis version

JSFiddle (Y-Axis)

JSFiddle (X-Axis)

like image 178
Ergec Avatar answered Sep 19 '22 17:09

Ergec


You could try something like this jquery plugin. It's not identical to Facebook but provides controlled crop functionality.

Otherwise, the question has been answered here: Is there a jQuery image cropping plugin similar to Facebook's image crop?

EDIT: Try this one: imgareaselect.

like image 41
Jarrod Avatar answered Sep 21 '22 17:09

Jarrod