2014-10-26 88 views
1

我使用kendo UI和jbox,我可以打開很多次kendo UI窗口它的工作完美。我在Kendo ui Window上整合了jbox模式窗口。如果我在kendo ui窗口上打開jbox模式窗口,它工作得太完美了。如果我不關閉kendo ui窗口,我可以打開很多次jbox模式窗口它工作良好。如果我重新打開劍道窗口,我可以打開jbox模式,但在jbox的JavaScript內容無法正常工作。我認爲這是關於JQuery,但我無法解決。 jQuery的1.9.1版本莫代爾窗口第二次打開Javascript停止

這裏是我的代碼,

我的索引;

var ICCANPopUp; 
$(document).on("click", ".k-overlay", function() { 
    ICCANPopUp.close(); 
}); 

$("#LoadFormDiv").kendoWindow({ 
    width: "750px", 
    height: "90%", 
    draggable: false, 
    resizable: false, 
    modal: true, 
    title: "", 
    visible: false, 
    open: function(e) { 
     this.wrapper.css({ top: 25 }); 
     $("html, body").css("overflow", "hidden"); 
    }, 
    close: function (e) { 
     $("html, body").css("overflow", ""); 
    } 

}); 
$('#LoadFormDiv').closest(".k-window").css({ 
    position: 'fixed', 
    margin: 'auto', 
    top: '20%' 
}); 

var ICCANPOPUPLOCATIONBEFOREOPEN; 
function ICCANPopUpShow() { 
    ICCANPopUp = $("#LoadFormDiv").data("kendoWindow"); 
    ICCANPopUp.content('<div style="margin-left:40%; margin-top:20%; ">Yükleniyor...<br/><img src="/Content/images/iccan-loader.gif" width="54" height="55" alt="iMarket Ürün Yükleniyor..." /></div>'); 
    ICCANPopUp.title(""); 
    ICCANPopUp.refresh({ 
     url: "/IccanApi/GetProductByID", 
     data: { ID: 3012 } 
    }); 

    ICCANPOPUPLOCATIONBEFOREOPEN = $(window).scrollTop(); 
    window.scrollTo(0,0); 
    ICCANPopUp.center().open(); 
} 

$("#LoadFormDiv").data("kendoWindow") 
.bind("close", function (e) { 
    $("html, body").animate({ scrollTop: ICCANPOPUPLOCATIONBEFOREOPEN }); 

}); 

劍道UI窗口腳本的

$('#FavouriteWrp').jBox('Modal', { 
    width: 602, 
    height: 495, 
    closeButton: true, 
    ajax: { 
    url: '/Account/Login', 
    data: '', 
    reload: true 
    }, 
    onClose: function() { ResetAllLoginStuff(); } 
}); 

Jbox模態窗口Conent腳本,(如果我關閉並重新打開劍道窗口,如果我打開jbox模態窗口後,該代碼不工作)

$("form").submit(function (e) { 
     $(".ICCAN-Register-processing").css({ "display": "block" }); 
     var emailForRegister = $("#UserName").val(); 
     var passwordForRegister = $("#Password").val(); 
     var passwordValidateForRegister = $("#PasswordValidate").val(); 
     var smsForRegister = $('#Sms').prop('checked'); 
     var mailingForRegister = $('#Mailing').prop('checked'); 
     var agreementForRegister = $('#agreement').prop('checked'); 

     $.ajax({ 
      url: '/Account/Register', 
      data: JSON.stringify({ 
       UserName: emailForRegister, 
       Password: passwordForRegister, 
       PasswordValidate: passwordValidateForRegister, 
       Sms: smsForRegister, 
       Mailing: mailingForRegister, 
       agreement: agreementForRegister 
      }), 
      type: 'POST', 
      contentType: 'application/json; charset=utf-8', 
      success: function (response) { 
       if (response.isSuccess) { 

        alert("Kayıt Başarılı"); 
        $(".ICCAN-Register-processing").css({ "display": "none" }); 
        window.location.replace("/"); 

       } 
       if (!response.isSuccess) { 
        $(".ICCAN-Register-processing").css({ "display": "none" }); 
        $("#UserName").css({ "border": "1px solid red" }); 
        $("#ResultText").show(); 
       } 
      } 
     }); 
     e.preventDefault(); 
     e.unbind(); 
    }); 
    $("#ResultText").hide(); 

有人可以幫助我,非常感謝

+0

在控制檯中是否有任何錯誤?當你重新打開kendo窗口時,什麼代碼不再工作了? – 2014-10-28 10:21:04

回答

0

當我刷新頁面,我看到了衝突jquery versi ob,所以我使用最新版本的jquery,問題消失了。