- //imageform
- let Crop = function()
- {
- return {
- DOM:{},
- init:function()
- {
- $('img#cropme').jQcrop({
- width: 400,
- height: 600
- }).on('crop.jQcrop',
- function(e, data)
- {
- // console.log(data);
- if (data.stretch)
- {
- console.log('image too small!!!!');
- }
- }
- );
- $('button.crop').click(
- function()
- {
- let state = $('img#cropme').data('jQcrop');
- console.table(state.result);
- return false;
- }
- )
- }
- }
- }
- // https://github.com/terebentina/jQcrop
- $(document).ready(
- function()
- {
- const crop = new Crop();
- crop.init();
- }
- )
Raw Paste