0

我正在使用 jqueryui 拖放(制作验证码插件)将图像拖到一个 div 容器中,然后我进行 ajax 调用。这是否可能是当我进行 ajax 调用并且它完成时,拖动图像的位置被重置?

我的拖动功能是(部分代码)

e("div.eL-captcha > div.eL-possibilities > img").draggable({
    opacity: .6,
    revert: "invalid",
    refreshPositions: true
});

我的ajax调用是

$.ajax({
    url: '../../captcha/miclass.php',
    type: 'post',
    data: $('#frm_sample').serialize(),
    success: function(data) {

    if(data=="Captcha error!")
    {
    alert("WRONG CAPTCHA ! Please Complete the Captcha By Choosing the correct image or for audio entering the right value");       
    }
    else
    {
    $("form")[0].reset();
    $(".mi_comments_container").prepend(data);

        }
});
4

1 回答 1

0

当然。在使它们可拖动之前,将位置保存在数组中或将其设置为图像作为数据属性。然后使用

$.each

将它们的左侧和顶部 css 值设置为您保存的原始值。

于 2013-07-24T21:11:13.173 回答