2013-07-24 17 views
0

我使用jQueryUI的拖放后拖动对象的刷新位置(使验证码插件)拖动图像为一体的div容器,之后我做一个AJAX调用。这是可能的,当我做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); 

     } 
}); 

回答

0

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

$.each 

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