Search code examples
javascriptjqueryjcrop

Setting the outer region of Jcrop selection to invisible


In the case where an image is overlaid on top of a different image, I would like to have vision of the background image while cropping the foreground image at same time.

Example: Image A is on top of Image B. Jcrop is applied to Image A and when a selection occurs, the area of selection shows only the selected part of Image A. Image B is visible in the background, surrounding the area of selection of Image A.

enter image description here enter image description here

Is this possible?


Solution

  • $(function($){
        $('#target').Jcrop({
            bgColor: '',
            bgOpacity: 0
        });
    });