Advertisement
Guest User

Untitled

a guest
Nov 10th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. $(document).ready(function(){
  2. var jcrop_api;
  3. $("#inner").draggable({
  4. containment: $('#content')
  5. });
  6.  
  7. $(".selImg").on("click", function(){
  8. var $this = $(this);
  9.  
  10. var imgUrl = $this.attr('src');
  11.  
  12. var imgUrlSplit = imgUrl.split("/small");
  13. var vpImg = imgUrlSplit[0]+imgUrlSplit[1];
  14. $("#inner").attr('src', vpImg);
  15.  
  16. });
  17.  
  18. $("#removeCrop").on("click", function(){
  19. jcrop_api.release();
  20. //jcrop_api.disable();
  21. });
  22.  
  23.  
  24. $("#doCrop").on("click", function(){
  25. var $this = $('#wrapper');
  26. $('#wrapper').Jcrop({
  27. onRelease: releaseCheck,
  28. },function(){
  29. jcrop_api = this;
  30. jcrop_api.animateTo([10,10,$this.width()-10,$this.height()-10]);
  31. jcrop_api.disable();
  32. });
  33. });
  34.  
  35. function releaseCheck() {
  36. jcrop_api.setOptions({ allowSelect: true });
  37. $('#can_click').attr('checked',true);
  38. };
  39.  
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement