Skip to content

Instantly share code, notes, and snippets.

@scottsappen
Created July 1, 2013 15:18
Show Gist options
  • Save scottsappen/5901750 to your computer and use it in GitHub Desktop.
Save scottsappen/5901750 to your computer and use it in GitHub Desktop.
Talk about an easy image cropper. http://deepliquid.com/content/Jcrop.html
<script src="../Scripts/jquery.Jcrop.min.js" type="text/javascript"></script>
<style type="text/css" media="all">@import "../Styles/jquery.Jcrop.css";</style>
<img id="mycroppable" src="#yoururl" title=""/>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
function setImageCropCoords(c) {
// variables can be accessed here as
//c.x, c.y, c.x2, c.y2, c.w, c.h
};
//cropper
$("#mycroppable").Jcrop({
onSelect: setImageCropCoords,
setSelect: [0, 0, 200, 200],
minSize: [200, 200],
maxSize: [200, 200]
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment