Quote:
Originally Posted by martynball
Hey, I need to give a user the ability to move a box around over and image to select an area, and then crop the image based on the area within the box.
Facebook has this feature when you change your display picture. What I don't understand is how you get the coordinates of each corner of the box and how Facebook dulls the rest of the image around the box.
I understand how to use the server side code to actually create the image, I just need to use JavaScript to get the coordinates.
|
those numbers are available as event attributes on mouseup, and mousemove event handlers.
clientX et al, just lookup the mouse events.
you can grey out the rest with css:
Code:
#cropbox { box-shadow:0 0 1000px rgba(0,0,0,0.75); cursor: move; }