I wrote an extedned plugin based on jCrop to crop mulitple images one after another.
I developed and debugged using Chrome and everything worked fine without any JavaScript issues. When i came to test in Explorer it fell over and threw a script error that wrote out
jcrop api is null or not an object
So my javascript is simply...
var jcrop_api; //Global var to be used thorugh out the client
//some code here
//jCrop documention tells us to use this to assign itself to an object.
//I look for both because i use .net masterpages and sometimes not.
$('#SourceImage, #body_SourceImage').Jcrop({},function () { jcrop_api = this; });
//some more code but not far down the line i need to set jCrop options using API
jcrop_api.setOptions({
boxWidth: bw,
onSelect: updateCoords,
minSize: [thisImage.Min.Width, thisImage.Min.Height],
aspectRatio: thisImage.AspectRatio
});
jcrop_api.setImage('../cache/uploads/' + fileName);
That all work in Chrome and i can change images using a global trigger. I have no idea why it does not work in IE?