ajax aftersuccess,Run jQuery Plugin after ajax form success

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值