ajax aftersuccess,Run jQuery Plugin after ajax form success

公西姚石
2023-12-01

I use jqueryForm plugin for updating an image without reloading page:

$(document).ready(function() {

$('#submitbtn').click(function() {

$("#viewimage").html('');

$("#viewimage").html('Uploading...');

$(".uploadform").ajaxForm({

target: '#viewimage',

}).submit();

});

});

Afterwards i want to use imgAreaSelect plugin (that works perfect when solo)

$(document).ready(function () {

$('img').imgAreaSelect({

aspectRatio: '166:90',

minHeight: 90,

minWidth: 166,

onSelectEnd: function (img, selection) {

$('input[name="x1"]').val(selection.x1);

$('input[name="y1"]').val(selection.y1);

$('input[name="x2"]').val(selection.x2);

$('input[name="y2"]').val(selection.y2);

$('input[name="width"]').val(selection.x2-selection.x1);

$('input[name="height"]').val(selection.y2-selection.y1);

}

});

});

Now second pluting doesn't work.

It seems that i have to use imgAreaSelect function right after jQuery Form success (there is such callback function in jQuery form documentation. Is it right way of thinking? How i have to do it? Thank you.

 类似资料:

相关阅读

相关文章

相关问答