Cytat(sowiq @ 17.10.2013, 12:43:59 )

Wystarczy chwilę pomyśleć...
$('.image_container').addClass('hide_part');
// LUB
$('.image_container').removeClass('hide_part');
.hide_part .jcrop-holder div div .jcrop-tracker{
background: rgba(255, 0, 0, 0.3);
}
No niestety coś mi to nie działa. Mam taki oto kod:
$(window).load(function(){
var jcrop_api, boundx, boundy;
$('.thumbnailimg').Jcrop({
bgFade: true,
bgOpacity: 1,
setSelect: [ 0, 0, 0, 0 ]
},function(){
jcrop_api = this;
});
$('input[type=radio][name=radio_ch]').click(function() {
if (this.value == 'cut') {
$('.thumbnailimg').Jcrop({
bgFade: false,
bgOpacity: 1,
onSelect: function(){
$.ajax({
type: "POST",
url: "ajax_modifyimg.php",
data: {imgBase64: img},
success: function (response) {
if(response.status === "Unable to save the file.") {
console.log('error');
} else {
var img = document.getElementById("example"),
$img = $(img),
imgW = img.naturalWidth,
imgH = img.naturalHeight;
console.log($img.width());
console.log($img.height());
var ratioY = imgH / $img.height(),
ratioX = imgW / $img.width();
var getX = $('#x').val(),
getY = $('#y').val(),
getWidth = $('#w').val(),
getHeight = $('#h').val();
Caman("#example", function () {
this.crop(getWidth, getHeight, getX, getY);
this.render(function () {
var imgg = this.toBase64();
$.ajax({
type: "POST",
url: "ajax_thumbnail.php",
data: {imgBase64: imgg}
}).done(function(o) {
console.log('saved');
});
});
});
console.log('success');
}
}
}).done(function(o) {
console.log('saved');
});
}
});
} else if (this.value == 'hide') {
$('.thumbnailimg').Jcrop({
addClass: 'hide_part'
});
}
});
});
<img id="example" class="thumbnailimg" src="modules/mod_raport/jpg_show_modify.php">
Nie działa również w tym przypadku:
} else if (this.value == 'hide') {
$('.thumbnailimg').addClass('hide_part');
}