본문 바로가기
javascript

[modal.js 실행 후 함수 실행] modal + image crop

by 바나냥 2020. 7. 7.
$("#image-crop-modal").one("shown.bs.modal", function() {
            //alert("d");
          $("#img-crop img").cropper({
              aspectRatio: 16 / 9,
              preview: "#exampleFullCropperPreview > .img-preview",
              responsive: true,
              crop: function crop() {
                var data = (0, _jquery.default)(this).data('cropper').getCropBoxData();
                $inputDataX.val(Math.round(data.left));
                $inputDataY.val(Math.round(data.top));
                $inputDataHeight.val(Math.round(data.height));
                $inputDataWidth.val(Math.round(data.width));
              }
          });
        });

댓글