0
I have a problem with my javascript code:
function() {
var largura = document.getElementById('fundo').width;
console.log("Largura da imagem:" + largura);
try{
new Cropper.Img(
'fundo',
{
onEndCrop: onEndCrop,
displayOnInit: true,
onloadCoords: { x1: 0, y1: 0, x2: largura, y2: largura },
ratioDim: { x: largura, y: largura }
}
);
}catch(e){
console.log('ERRO');
}
}
This function is responsible for sending the size of an image to another script, which will show on top of the image a square to cut. My problem is you’re not getting into new Cropper.Img. The error the browser displays: Uncaught Typeerror: Cannot read Property 'Img' of Undefined. If anyone can help me I’d be very grateful, that code is part of a college job.
Which component you are using (Cropper) and its documentation page?
– Sam
http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/ At this link you can download the file, it’s Cropper.js
– Fred Coutinho
Just drop the zip
– Fred Coutinho