I've been working on this one for a while. Works fine in FF and Chrome, but not in IE10. I am uploading an image w/ ajax and in IE10, Jcrop is not firing properly.

I do have some hidden elements, and I'm hiding and showing things in javascript. I've found the following three issues that may be related, but haven't been able to get it working after reading them.

Much thanks, and I otherwise love this module.
John

http://stackoverflow.com/questions/5937208/jcrop-jquery-sometimes-fails-...
http://stackoverflow.com/questions/13699178/issue-with-jcrop-and-ie-and-...
https://code.google.com/p/jcrop/issues/detail?id=32

Comments

jcsnyder’s picture

Ok, I've finally figured out something that works for me.

I used Jeff Widmer's answer here: http://stackoverflow.com/questions/10916412/ie-problems-with-jcrop

This is his code below, but basically you check for msie, and then use $(this).Jcrop({ for non-msie, and jcrop_obj = jQuery.Jcrop(this, { for msie. Hope this helps somebody!

var is_msie = /msie/.test(navigator.userAgent.toLowerCase());
var jcrop_obj;

if (is_msie) {
jcrop_obj = jQuery.Jcrop('#img', {
onSelect: jcrop_onEndCrop,
minSize: [ 20, 20 ],
setSelect: [ x, y, x2, y2 ],
allowSelect: false
});
}
else {
jQuery('#img').Jcrop({
onSelect: jcrop_onEndCrop,
minSize: [ 20, 20 ],
setSelect: [ x, y, x2, y2 ],
allowSelect: false
},function(){jcrop_obj = this;});
}

joetsuihk’s picture

Status: Active » Needs work

You need to write a patch for your code to goes into the module. https://drupal.org/project/imagefield_crop/git-instructions

But you should use $ instead of jQuery, https://drupal.org/node/121997

and I do not have IE10 on my hand, I think the msie code should also works for Chrome and ff?

jcsnyder’s picture

joetsuihk,

Will do - please give me some time to figure it out and put it together.

thx.
john

superdorx’s picture

Good job! Looking forward to your patch.