scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 304 forks source link

how to include external source and set to the correct address #149

Open jacondaloas opened 8 years ago

jacondaloas commented 8 years ago
<script>
  $(function() {
    $('.image-editor').cropit({imageState: {
        src: 'http://wallpapercave.com/wp/dOKlswl.jpg',
      },
    });

    $('.image-editor').cropit('previewSize', { width: 500, height: 150 });

    $('form').submit(function(e) {
        e.preventDefault();

        var imageData = $('.image-editor').cropit('export',{
            type: 'image/jpeg',
            quality: .6
        });
        var hidden = $('.hidden-image-data').val(imageData);

        var form = $('form');
        var formData = new FormData(form[0]);

        $.ajax({
            type: "POST",
            processData: false,
            contentType: false,
            url: "i.php",
            data:  formData,
            success: function(data){

                alert(data);
            }
        })
    });
});
</script>
jacondaloas commented 8 years ago

already included but the address site.ru/img.jpg will not ship

jacondaloas commented 8 years ago

already earned, thanks for the plug, waiting for the chance to turn