jcrop turns transparent image black

孤街醉人 提交于 2019-12-04 06:27:27

That is because the default option for bgColor in jCrop is set to 'black'.

Just add the option for bgColor in your init to be nothing and your image will be transparent:

 $('#transparent').Jcrop({
    onChange: showCoords,
    bgColor: ''
},function(){
    jcrop_api = this;
});

Here is the solution (link). I changed the image to a div with transparent color by using rgba(0,0,0,0). Let me know if this is what you are trying to achieve.

<div id="transparent" style="width: 100px; height: 100px;position: absolute; left: 0px: right: 0px; background: rgba(0,0,0,0);"/>

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!