TEXT   55
imageform
Guest on 18th September 2023 12:27:19 PM


  1. //imageform
  2. let Crop = function()
  3. {
  4.     return {
  5.         DOM:{},
  6.         init:function()
  7.         {
  8.             $('img#cropme').jQcrop({
  9.                  width: 400,
  10.                  height: 600
  11.             }).on('crop.jQcrop',
  12.                 function(e, data)
  13.                 {
  14. //                     console.log(data);
  15.                     if (data.stretch)
  16.                     {
  17.                         console.log('image too small!!!!');
  18.                     }
  19.                 }
  20.             );
  21.            
  22.             $('button.crop').click(
  23.                 function()
  24.                 {
  25.                     let state = $('img#cropme').data('jQcrop');
  26.                     console.table(state.result);
  27.                     return false;
  28.                 }
  29.             )
  30.         }
  31.     }
  32. }
  33.  
  34. // https://github.com/terebentina/jQcrop
  35.  
  36. $(document).ready(
  37.     function()
  38.     {
  39.         const crop = new Crop();
  40.         crop.init();
  41.     }
  42. )

Raw Paste

Login or Register to edit or fork this paste. It's free.